> ## Documentation Index
> Fetch the complete documentation index at: https://parabola.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# How do I create a JSON body in Parabola?

There are **three main ways** to construct a JSON body in Parabola, depending on your use case:

## **1. Create JSON in an API Step (for API Requests)**

If you're building a JSON body to send in a `POST`, `PATCH`, or `PUT` API request, use the **API step** and enter the JSON directly into the **Request Body** field.

* **Use merge tags** to dynamically insert data from your flow. A merge tag is a column name wrapped in **single curly braces**, like `{order name}`.
* Parabola will automatically replace these with the actual values from the referenced column when the flow runs.

**Example:**

```json theme={null}
{
  "order_id": "{order name}",
  "status": "shipped"
}
```

## **2. Create JSON in a Column (Using Add Text Column Step)**

If you need to build JSON **within your flow** (e.g., to generate line items for an array), use the **Add text column** step.

* Write your JSON structure as plain text.
* Reference column values with **merge tags**, using single curly braces like `{inventory amount}`.
* Parabola will substitute these with the correct values when the flow runs.

**Example:**

```json theme={null}
{
  "sku": "{product code}",
  "quantity": {inventory amount}
}
```

This method is especially useful when creating line items. You can then use the **Merge duplicate rows** step to combine them into a single array string, using commas or line breaks as delimiters.

### **Example: Creating Line Items in JSON and Merging Them into an Array**

Let's say you have a table like this:

| order id | sku     | quantity |
| :------- | :------ | :------- |
| 12345    | ABC-001 | 2        |
| 12345    | XYZ-999 | 1        |

<Steps>
  <Step title="Use Add text column to create line item JSON per row">
    In the **Add text column** step, create a new column, called "line item JSON," with this JSON structure:

    ```
    {"sku": "{sku}", "quantity": {quantity}}
    ```

    Your output will look like:

    | order id | sku     | quantity | line item JSON                     |
    | :------- | :------ | :------- | :--------------------------------- |
    | 12345    | ABC-001 | 2        | \{"sku": "ABC-001", "quantity": 2} |
    | 12345    | XYZ-999 | 1        | \{"sku": "XYZ-999", "quantity": 1} |
  </Step>

  <Step title="Use Merge duplicate rows to group line items by order">
    * Group by `order id`
    * Merge the **line item JSON** column
    * Use **comma** as the delimiter

    Your result:

    | order id | line item JSON                                                         |
    | :------- | :--------------------------------------------------------------------- |
    | 12345    | \{"sku": "ABC-001", "quantity": 2}, \{"sku": "XYZ-999", "quantity": 1} |

    You now have a properly formatted JSON array string of line items for each order, ready to include in an API call or another downstream step.
  </Step>
</Steps>

## **3. Create JSON Using the Custom Transform Step**

For more complex JSON structures, use the **Custom transform** step. This step allows you to describe the JSON you want, and Parabola will generate code to build it for each row.

* **Be specific** in your instructions.
* Include an **example JSON output** when possible.
* Remind the step to wrap column names in single curly braces. For example, reference a column like this: `{total price}`.

**Step Instruction Tip:**

When writing your prompt in the Custom transform step, say something like:

"Create a JSON object that includes `total_price` from the column named 'total price'. Wrap all column references in single curly braces like `{column name}`."

Each method has different strengths depending on your goal—use API step for external calls, Add text column for row-level JSON strings, and Custom transform for complex, rule-based JSON creation.
