jsonPathGetValue Step

Last published at: August 11th, 2022

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 properties
  • 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.