> For the complete documentation index, see [llms.txt](https://docs.locoia.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.locoia.com/automation/flow-builder/connectors-and-apis/accessing-objects-with-jsonpath.md).

# 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](https://jsonpath.com/) (don't enter any private information).

### Code example

{% tabs %}
{% tab title="JSON Response Payload" %}

```javascript
{ "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
    }
  }
}
```

{% endtab %}
{% endtabs %}

### Reference examples and descriptions

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.locoia.com/automation/flow-builder/connectors-and-apis/accessing-objects-with-jsonpath.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
