Input Path |Filter and Control JSON Input for State Processing | Online Help | Circuit

Input Path

Input Path enables you to filter and control the actual input passed to the state. By defining an Input Path (either in Builder View or Code View), using JSONPath notation, you can select a portion of the JSON input and use it for processing within the state.

Consider the following JSON, received as an output from the state's execution, which represents the state input: 

{
"employee1": {
"name": "Angelina",
"emp_id": "357",
"location": "CA"
},
"employee2": {
"name": "Martin",
"emp_id": "543",
"location": "New York"
}
}


Let's apply the Input Path (in Code view) within the state definition:

 {
"get_employee_details": {
"type": "pass",
"next": "End",
"start": true,
"input_path": "$.employee2"
}
}


As a result, the JSON input passed to the state will be:

{
   "name": "Martin",
   "emp_id": "543",
   "location": "New York"
}

The state will now process the filtered JSON only containing the details of 'User2', as specified by the applied Input Path. This allows you to work with a specific subset of the original JSON input within the state's processing logic.



Next: Parameters