JSONPath
XPath is supported, but JSONPath isn't?
I can see the "Get Value from JSON by Name" , which also has an array version. But these seem to only work at one level. Is this really true?
So if I want something nested two levels down I need two steps? And 5 levels, 5 steps?
But strangely "Get JSON path from Value" returns all sorts of JSONPath formats. If we look at the examples which will accept an input of "..[?(@.author == 'Nigel Rees')]" and return store.book[0]
Am I missing something here?
Comments
-
Hello!
Both the ‘Get Array From JSON By Name’ and ‘Get Value From JSON By Name’ steps can use JSONPath values for the ‘Array Name’ or ‘Name’ input in their properties.
For example, with the below JSON structure, to get the ‘price’ value for ‘Sword of Honour’ (store>book>price), you can configure a ‘Get Array From JSON By Name’ step with ‘Array Name’ set to
‘..[?(@.title == 'Sword of Honour')]’
Then use a ‘Get Item by Index’ step with ‘Item Index’ set to 3.
{"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}
}}
‘Get Array From JSON By Name’ Input/Output data:
For more information on these JSON steps please see the below documentation:
https://documentation.decisions.com/step-library/docs/get-array-from-json-by-name
https://documentation.decisions.com/step-library/docs/get-value-from-json-by-name
https://documentation.decisions.com/step-library/docs/get-json-path-from-value
-
OK, cheers. Turns out I'm just useless with JSONpath :)
I've put in a documentation suggestion for these pages to clarify the functionality.
Thanks again.
Howdy, Stranger!
Categories
- 4.1K All Categories
- 61 General
- 11 Training
- 201 Installation / Setup
- 1.1K Flows
- 106 Rules
- 260 Administration
- 212 Portal
- 489 General Q & A
- 693 Forms
- 333 Reports
- 3 Designer Extensions
- 47 Example Flows
- 51 CSS Examples
- 1 Diagram Tile
- 7 Javascript Controls
- 178 Pages
- 5 Process Mining
- New Features
- 178 Datastructures
- 69 Repository
- 219 Integrations
- 28 Multi-Tenant
- 27 SDK
- 76 Modules
- 56 Settings
- 25 Active Directory
- 12 Version 7
- 35 Version 8
- 66 Lunch And Learn Questions