# JSON File Destination

Astera’s *JSON File Destination* object provides the functionality to write data to a JSON file when the incoming data is in a hierarchical format.

### Use Case

To better understand how to write to a *JSON File Destination* object, we will take help of a use case where we have a source file containing hierarchical records of customers' orders. These records are being parsed using a *JSON Parser* object, and we now need to write them to a JSON File.

<figure><img src="/files/28fplmFHU7Lno3pRHM3Z" alt="" width="375"><figcaption></figcaption></figure>

#### Configuring the JSON File Destination Object

1. To get started, let’s drag-and-drop a *JSON File Destination* object from the *Toolbox* in the *Destinations* section.

<figure><img src="/files/2CjRK2ADFO1ItMAbQA1c" alt=""><figcaption></figcaption></figure>

2. Right-click on the object’s header and select *Properties* from the context menu.

<figure><img src="/files/JhEHRh8edW41oTZ21Yww" alt="" width="375"><figcaption></figcaption></figure>

3. Specify the file path where you would like to save your destination file. Click *Next*.

<figure><img src="/files/DKt1hdMFoHRljyjcL6Cj" alt="" width="563"><figcaption></figcaption></figure>

4. In this window, you can define the layout of your destination object. Astera offers multiple ways to configure the layout based on your use case:

* *Generate Layout by Providing Sample Text*: Automatically generates the layout using an example input text.

<figure><img src="/files/hz9x5Zp4CfsdcpzJX21I" alt="" width="563"><figcaption></figcaption></figure>

* *Generate Layout by Provided File Path*: Automatically generates the layout using a specified file path. This option is particularly useful when writing to a predefined

<figure><img src="/files/2Wfm3EnwJgMDVHroNK1b" alt="" width="563"><figcaption></figcaption></figure>

* *Manual Layout Configuration*: Allows you to define the layout manually according to your preferred structure and formatting.
* *Map Layout from Previous Object*: Reuses the layout configuration from the preceding object. This is ideal when no changes are required from the previous layout.\
  For our use case, we will be mapping the layout from our previous object.

<figure><img src="/files/umOYjymei7qB7fWJQA7l" alt=""><figcaption></figcaption></figure>

5. Once the layout has been configured, click *Next*.\
   A *Config Parameters* window will open, which will allow us to further configure and define parameters for the *JSON Destination* object.\
   Parameters can provide easier deployment of flows by eliminating hardcoded values and provide an easier way of changing multiple configurations with a simple value change.

<figure><img src="/files/LdBkL2dMns1tOIhURvf8" alt="" width="563"><figcaption></figcaption></figure>

{% hint style="info" %}
***Note:*** Parameters left blank will use their default values assigned on the properties page.
{% endhint %}

6. Cick *Next*, the *General Options* window will open. On this window:

* Comments can be added.
* General Options are given, which relate to processing of records in the destination file.

<figure><img src="/files/EpVf5eL8qC80YGJkh1Yr" alt="" width="563"><figcaption></figcaption></figure>

7. Click *OK*.

The *JSON File Destination* object has been successfully configured, and the destination file can now be created by running the dataflow.


---

# 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://documentation.astera.com/dataflows/destinations/json-file-destination.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.
