# Merging nested JSON objects

If you have multiple nested JSON Objects (with no duplicate attribute names) like in this example object named `Statement`:

```json
{
  "Amount": {
    "Currency": "EUR",
    "Value": "10.99"
    },
  "Valuation_Date": {
    "Date": "2022-01-24"
    },
  "References": {
        "FullRef": "CTC123456879",
        "ClearRef": "123456789"
        }
}
```

You can merge them into a flat one using the following code snipped:

```django
{
  {% for object in [Statement.Amount, Statement.Valuation_Date, Statement.References] %}
    {% for key, value in object.items() %}
      "{{ key }}": "{{ value }}",
    {% endfor %}
  {% endfor %}
}
```

To receive:

```django
{
    "Currency": "EUR",
    "Value": "10.99"
    "Date": "2022-01-24
    "FullRef": "CTC123456879",
    "ClearRef": "123456789"
}
```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.locoia.com/automation/flow-builder/connectors-and-apis/merging-nested-json-objects.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
