Result selector lets you retrieve and process the runtime data, enabling flexible and dynamic data manipulation within your application. With this, you can precisely control the relevant and essential parts of the state's result, excluding unnecessary data or modifying existing values as needed.
To implement the desired modifications, you define key-value pairs where each key represents a specific result modification. The corresponding values associated with these keys can be either static or dynamically derived from the state's result. By using the Result Selector, you can tailor the data to be sent to the Result Path based on your specific needs.
{"status": "success","message": "Employee onboarded successfully.","emp_id": "543","name": "Martin","department": "Product Management","joining_date": "2023-07-23","designation": "PM Associate","manager": "Jane Smith","location": "New York","salary": 75000,"benefits": ["Health Insurance","401(k) Plan","Paid Time Off"],"documents": {"offer_letter": "offer_letter_EMP12345.pdf","employment_contract": "empcontract_EMP12345.pdf","tax_forms": "tax_forms_EMP543.pdf"}}
Suppose, the 'employee_department' and 'offer_letter' alone in this result is expected in the next state, here's how it can be achieved using the Result Selector in code view:
{"get_employee_details": {"type": "circuit","next": "End","start": true,"circuit_id": "<Circuit_Name>","result_path": "$.Output","result_selector": {"employee_department": "$.department","letter_of_intent": "$.documents.offer_letter"}}}
"output": {"employee_department": "Product Management","letter_of_intent": "offer_letter_EMP543.pdf"}
Only the necessary information is extracted from the result and passed as output.
Result Path enables you to adjust the output of a state. Within the Result Path, you can specify the state's input, the state's result, or a combination of both as the state's output. Essentially, you have the option to append the state's result to the JSON input given to the state and make alterations. You can then pass this modified JSON as the state's output to the next state for processing. It's important to note that if the Result Selector is configured, Result Path becomes mandatory.
Result Path is available for all the states except Branch, Wait, Success, and Failure.
{"org_name": "Global Solutions","employee_details": {"name": "Martin","emp_id": "543","role": "PM Associate"}}
Let the state result received be the following:
"location": "New York"
To keep the state input intact and to append the state result to it, set result_path to $.location:
{"get_employee_details": {"type": "pass","next": "End","start": true,"result_path": "$.employee_details.location","result": "New York"}}
{"org_name": "Global Solutions","employee_details": {"name": "Martin","emp_id": "543","role": "PM Associate","location": "New York"}}
Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.
If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.
You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.