jsonPathGetValue Step

Use this step to get JSON return value.

Last published at: September 4th, 2024

Description:

Perform to get JSON Result value

Inputs

  • varGlobalHoldingJson  - Variable or Global that holds the JSON string values
  • jsonPathExp - JSON Path Expression
  • mapping - map multiple JSON Path expressions and returns
  • varGlobalResult - Store result in Variable or global 
 

 

Returns

  • Match – Found JSON path value
  • NoMatch – JSON path not found value 
 

 

Usage:

 

 

Example:

Let’s build and execute the JsonPathGetValueDef example.          

  • Create a new definition called “JsonPathGetValueDef”
  • Select the definition and click the “design” button
  • Drag the “ExecuteSQL” and “JsonPathGetValue” steps from the toolbox
  • Connect the dots between the controls as shown above
  • Click the “ExecuteSQL” step to configure its “Settings” properties. Provide a name to the step. Select the connection string from the drop-down list. Provide the Select SQL query for execution. Select the result format as JSON. Click on the Save button to save the configuration. 

 

  • Click the “ExecuteSQL” step to configure its “Advanced” properties. Provide the name of the other database for the SQL query execution (when the field value is blank, the default database is considered).  Provide the variable/global to store the XML or JSON result. Select YES if you prefer a single SQL row result set. Provide the SQL command time-out value in seconds (when the field value is blank, the default configuration value is considered). Click the button to map the SQL result set fields to process instance variables. 

 

  • Click the "JsonPathGetValue" step to configure its "Settings" properties. Provide a name to the step. Provide the variable/global to hold the JSON result. 

 

  • Click on the "JsonPathGetValue" step to configure its "Advanced" properties. Provide JSON Path expression and the variable/global reference for the JSON result. Click the button to map multiple JSON path expressions with variable/global references. You may get JSON values using single or multiple path expressions but not both. Here $.Row[*].length path expression returns the total count of the records available in the SQL result set. 

 

  • You may refer to this website for more JSONPath expression syntax. 

https://jsonpath.com/ 

 

  • Save the process definition, create a new instance, and execute. Render the process instance. Click on the “JsonPathGetValue” process step to view its properties. The step should get JSON result value.

 

Definition Sample:

You may download the sample definition from the link here and later import it (drag-drop) to your FlowWright Process Definition page. You must verify the process steps and complete the database configuration after import.  

https://github.com/FlowWrightCode/FW10Steps/blob/main/JSONPathGetValueStepDef.xml