Ask or search…

Accessing Objects with JSONPath

Accessing Objects and List Items with JSONPath in the Flow Builder Results
Locoia uses JSONPath for referencing data. Note that $ is not required anywhere within the app. Instead, we use Jinja2 so $.store.book[*].author becomes {{ store.book[*].author }} in Locoia.
Test your JSONPath with the JSON Path Visualizer Tool (don't enter any private information).

Code example

JSON Response Payload
{ "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

Reference examples and descriptions

The authors of all books in the store
All authors
All things in store, which are some books and a red bicycle
The price of everything in the store
The third book
The last book via script subscript
The last book via slice
The first two books via subscript union
The first two books via subscript array slice
Filter all books with isbn number
Filter all books cheaper than 10
Filter all books that cost 8.95
$..book[?(@.price<30 && @.category=="fiction")]
Filter all fiction books cheaper than 30
All members of JSON structure