Get Json Path From Value
  • 29 Mar 2023
  • 1 Minute to read
  • Dark
    Light

Get Json Path From Value

  • Dark
    Light

Article summary

Step Details

Introduced in Version3.9.0
Last Modified in Version7.12.0
LocationData > Text

The Get JSON Path From Value step provides a way to retrieve the JSON path for a field in a JSON Object based on a token value. The token value will need to be defined as a JSON Path expression.



Properties

Inputs

PropertyDescriptionData Type
JSON StringThe string input for the JSON objectString
Token ValueThe token value used as criteria used to generate the JSON PathString

Outputs

PropertyDescriptionData Type
JSON PathThe outputted JSON PathString

Example Inputs and Outputs

Json StringToken ValueOutput

{"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}],

"bicycle": {"color": "red","price": 19.95}

}}

..[?(@.author == 'Nigel Rees')]
store.book[0]

{"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}],

"bicycle": {"color": "red","price": 19.95}

}}

Nigel ReesEmpty String

{"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}],

"bicycle": {"color": "red","price": 19.95}

}}

..[?(@.price > 10)][store.book[1], store.bicycle]

{"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}],

"bicycle": {"color": "red","price": 19.95}

}}

NullEXCEPTION MESSAGE



Was this article helpful?