# CSV to JSON

## Description

This operation converts a CSV file to JSON format.

***

## Data types

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

### Input data

![](/files/SQ9k5y99hrpQppBSKJOF) - CSV-formatted strings you want to transform into JSON.

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

![](/files/OqZOURzyWzbgIRI5oux3) - Resulting JSON-formatted strings.

***

## 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 each row.

</details>

<details>

<summary>Row delimiter</summary>

This setting defines the character used to separate rows, if any.

</details>

<details>

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

Format of the resulting JSON. Choose between:

* **Array of dictionaries** - Each row in the CSV is converted into an object (similar to a dictionary) with key-value pairs where the keys are column headers.
* **Array of arrays** - Each row in the CSV is converted into a JSON array, with values only and no keys (useful if you don’t need named fields).

</details>

***

## Example

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

1. In your Pipeline, open the required [Action](/the-workspace/pipelines/actions.md) configuration and select the input **Field**.
2. In the **Operation** field, choose **CSV to JSON**.
3. Set **Cell delimiter** to `,` (comma).
4. Leave the **Row delimiter** field empty.
5. Set **Format** to **Array of dictionaries**.
6. Give your **Output field** a name and click **Save**. The CSV strings in your input field will be transformed into JSON.&#x20;

For example, the following CSV:

```csv
First name,Last name,Age,City
John,Wick,20,New-York
Tony,Stark,30,Madrid
```

will be transformed into this JSON:

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

{% 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 %}


---

# 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.onum.com/the-workspace/pipelines/actions/transformation/field-transformation/field-transformation-operations/format-conversion/csv-to-json.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.
