jsonPathGetValue Step

Use this step to get JSON return value.

Last published at: July 7th, 2023

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 expression 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 UpdateVariable and JsonPathGetValue step from the toolbox
  • Connect the dots between the controls as shown above
  • Click on the “UpdateVariables” step to configure its properties. Provide the JSON value to the variable.
  • Click on the "JsonPathGetValue" step to configure its "Settings" properties. Provide a name to the step. Provide the variable/global to holds the JSON string. 
  • Click on the "JsonPathGetValue" step to configure its "Advanced" properties. Provide JSON Path expression. Map multiple JSON path expressions and returns. Provide the variable/global to hold the result.
  • Map multiple JSON path expression and returns
  • Map multiple JSON path expression and returns
{      "store": {          "book": [              {                  "category": "reference",                  "author": "Nigel Rees",                  "title": "Sayings of the Century",                  "price": 8.95              },              {                  "category": "fiction",                  "author": "Evelyn Waugh",                  "title": "Sword of Honour",                  "price": 12.99              },              {                  "category": "fiction",                  "author": "Herman Melville",                  "title": "Moby Dick",                  "isbn": "0-553-21311-3",                  "price": 8.99              },              {                  "category": "fiction",                  "author": "J. R. R. Tolkien",                  "title": "The Lord of the Rings",                  "isbn": "0-395-19395-8",                  "price": 22.99              }          ],          "bicycle": {              "color": "red",              "price": 19.95          }      },      "expensive": 10  }
  •   Save the process definition, create a process instance and execute. The step should get JSON result value.