Configure Pass state in Circuit | Qntrl | Circuit | Online Help

Pass

The Pass state serves the purpose of forwarding data to the next specified state.  It allows you to pass the input data as-is or include supplementary information if needed during the process. To put it differently, with this state, you can insert new data or make changes (or manipulations) to the input JSON data by configuring the Input path, Output path, or Result path fields as discussed in the Input & Output processing section.
 
Besides the common fields, Pass state also has an additional Result field, which is not available in any other states. This field is used to insert a new object into the input JSON data and pass the modified JSON data as the input to the next state. The path of the new object added to the input is to be defined in the Result Path. If the Result Path and Result are not specified in the circuit, the state simply passes the input data as such to the next state.  
 
Use case Example: Let's consider the use case of automating IT tasks involved in the employee onboarding process. In this scenario, the HR department supplies the new employee details as an input JSON to the Circuit, which includes attributes like name, date of birth, and role. Now, the HR department wants to augment the input JSON with additional data, like the employee's work location, and then pass this modified input to the next state in the process.
 
To achieve this, the path for the new attribute to be added in the input JSON has to be specified in the Result Path field, which is represented as '$.key'(Ex: $.location) and the corresponding value for the new attribute has to be specified in the Result field. As a result, the modified JSON input to the next state will include the objects with attributes for name, date of birth, role, and location.
 
We will now explore the steps to configure the mentioned process in the Pass state, both in Builder View and Code View.

Builder view

To use a Pass state in Builder View:

  1. In Builder View, drag and drop the Pass state from the left pane into your circuit or click the required Pass state in your circuit.

  2. Under the Configuration tab, update the common state field attributes.

  3. Select the Input/Output tab located on the right side of the builder view page, and establish the paths. For further details, refer to the Input/Output Processing section

  4. For inserting a new parameter to the input passed, enter the key (in format '$.fieldname') in ResultPath and the value within Result.

      

Code view

In Code View, you can directly add the parameters resultPath and result within the state.

The JSON input to the state is:

{
"org_name": "Global Solutions",
"employee_details": {
"name": "Henry",
"date of birth": "15-03-1990",
"role": "Business Analyst"
}
}

In Pass state, you can add the new parameter location in the Result Path as below:
{
"Get Employee Details": {
"start": true,
"type": "pass",
"next": "End",
"input_path": "$.employee_details",
"output_path": "$.employee_details",
"result_path": "$.location",
"result": "New York"
}
}


Then the JSON output will be:
{
"org_name": "Global Solutions",
"employee_details": {
"name": "Henry",
"date of birth": "15-03-1990",
"role": "Business Analyst",
"location": "New York"
}
}



Next : Branch state

    • Related Articles

    • Result Selector and Result Path

      Result Path and Result Selector are employed to extract dynamic data from the state's result when the execution is successful. Result Selector Result Selector lets you retrieve and process the runtime data, enabling flexible and dynamic data ...
    • 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 ...
    • Output Path

      Output Path enables you to select a portion of the state's output and transfer it to the next state for processing, eliminating any unecessary objects from the JSON output. If the Output Path isn't specified, the entire JSON node (determined by the ...
    • JSON Path

      Path serves to locate specific parts or components within a JSON object. These paths start with the '$' symbol and follow JSONPath syntax. It is used to access particular elements or values within JSON objects passed in the Input Path, Output Path, ...
    • Parameters

      Parameters provide the ability to customize JSON input by adding a collection of key-value pairs as input to a task. These values can either be static or dynamically selected from the JSON input or the context object using specific paths. Context ...

    You are currently viewing the help articles of Qntrl 3.0. If you are still using our older version and require guidance with it, Click here.