# JSON to CSV

## Description

This operation converts JSON data into a CSV file.

***

## Data types

These are the input/output expected data types for this operation:

### Input data

![](https://965373739-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkxZeV4nlXcIAjMGZxzLI%2Fuploads%2FZmr35bwgundYfOW63E3q%2Fimage.png?alt=media\&token=2ba8baff-b40b-4dd4-ae2c-2a2ad5696788) - JSON data you want to transform into CSV. They must be strings formatted as JSON data.

### Output data <a href="#output-data" id="output-data"></a>

![](https://965373739-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkxZeV4nlXcIAjMGZxzLI%2Fuploads%2FRDngsaxu99O216cFqn81%2Fimage.png?alt=media\&token=53e171be-7591-4c56-acdb-4e8e8646241d) - Resulting CSV files.

***

## Parameters

These are the parameters you need to configure to use this operation (mandatory parameters are marked with a <mark style="color:red;">**\***</mark>):

<details>

<summary>Cell delimiter<mark style="color:red;"><strong>*</strong></mark></summary>

This setting defines the character used to separate cells (or columns) in the resulting CSV

</details>

<details>

<summary>Row delimiter<mark style="color:red;"><strong>*</strong></mark></summary>

This setting defines the character used to separate rows in the resulting CSV.

</details>

***

## Example

Suppose you want to convert a series of events in **JSON** format into **CSV**:

1. In your Pipeline, open the required [Action](https://onum.gitbook.io/onum-docs/the-workspace/pipelines/actions) configuration and select the input **Field**.
2. In the **Operation** field, choose **JSON to CSV**.
3. Set **Cell delimiter** to `,` (comma).
4. Set **Row delimiter** to `\n` (new line)
5. Give your **Output field** a name and click **Save**. The JSON-formatted strings in your input field will be transformed into CSV.&#x20;

For example, the following JSON:

```json
[
  {
    "First name": "John",
    "Last name": "Wick",
    "Age": "20",
    "City": "New-York"
  },
  {
    "First name": "Tony",
    "Last name": "Stark",
    "Age": "30",
    "City": "Madrid"
  }
]
```

will be transformed into this CSV:

<pre class="language-csv"><code class="lang-csv"><strong>First name,Last name,Age,City       
</strong>John,Wick,20,New-York
Tony,Stark,30,Madrid
</code></pre>

{% hint style="info" %}
You can try out operations with specific values using the **Input** field above the operation. You can enter the value in the example above and check the result in the **Output** field.
{% endhint %}
