# CSV Module

* [Definition](#definition)
* [Configuring the CSV module](#configuring-the-csv-module)
  * [Convert CSV to JSON operation](#convert-csv-to-json-operation)
  * [Convert JSON to CSV operation](#convert-json-to-csv-operation)
    * [Parameters](#convert-json-to-csv-operation)

### Definition <a href="#definition" id="definition"></a>

The "**CSV"** tool module, standard module for use in any flow, was created for converting data from the "**CSV"** file format to **JSON** and vice versa.

The "**CSV"** module consists of two operations, "**Convert CSV to JSON"** and "**Convert JSON to CSV"**.

### Configuring the CSV module <a href="#configuring-the-csv-module" id="configuring-the-csv-module"></a>

The "**CSV"** module appears in the **Tools** option when editing a flow. When added to a flow, it offers two operations:

* **Convert CSV to JSON**: converts a spreadsheet in CSV to JSON format.
* **Convert JSON to CSV**: converts a spreadsheet in JSON to CSV format

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

#### Convert CSV to JSON operation <a href="#convert-csv-to-json-operation" id="convert-csv-to-json-operation"></a>

This operation allows you to convert a CSV table with different items (products, customers, etc.) to JSON format, so that this information can be used later in the flow.

To use this option, choose "**Convert CSV to JSON"** and then click "**Save"**.

If you click to edit the module, the following area will be displayed for configuring the variables:

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

Where:

* **CSV**: enter the text in CSV format that needs to be converted. If you prefer, click on the plus sign ( ) to configure a [SMOP](/english/skyone-studio/integrations/flows/data-operations/smop-small-operations.md).
* **Delimiter**: CSV separator character, used to read the CSV and then create the JSON.
* **CSV CONVERTED TO JSON**: here, after you click on the "**Validate"** button, the CSV converted to JSON format will be displayed.

Example CSV:

```json
id,name,description,price,available
1,Jaleco,Jaleco de alta qualidade fabricado para atender aos clientes mais exigentes,"R$ 999,99",true
2,Avental,Jaleco de alta qualidade fabricado para atender aos clientes mais exigentes,"R$ 999,99",true
3,Touca,Jaleco de alta qualidade fabricado para atender aos clientes mais exigentes,"R$ 999,99",true
4,Fronha,Jaleco de alta qualidade fabricado para atender aos clientes mais exigentes,"R$ 999,99",true
5,Embalagem,Jaleco de alta qualidade fabricado para atender aos clientes mais exigentes,"R$ 999,99",true
6,Porta talher,Jaleco de alta qualidade fabricado para atender aos clientes mais exigentes,"R$ 999,99",true
7,Porta absorvente,Jaleco de alta qualidade fabricado para atender aos clientes mais exigentes,"R$ 999,99",true
```

#### Convert JSON to CSV operation <a href="#convert-json-to-csv-operation" id="convert-json-to-csv-operation"></a>

This operation allows you to convert a JSON table with different items (products, customers, etc.) to CSV format, so that this information can be used later in the flow.

To use this option, choose "**Convert JSON to CSV"** and then click "**Save"**.

If you click to edit the module, the following area will be displayed for configuring the variables:

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

Fields:

* **Delimiter**: CSV separator character, used to create the file in this format;
* **Convert arrays**: this option allows you to ignore or convert the arrays of a code in JSON to CSV format;
* **JSON**: enter the code in JSON format that needs to be converted;
* **JSON CONVERTED TO JSON**: here, after you click the **Validate** button, the JSON converted to CSV format will be displayed.

JSON example:

```json
[
   {
      "id":1,
      "name":"Jaleco",
      "description":"Jaleco de alta qualidade fabricado para atender aos clientes mais exigentes",
      "price":"R$ 999,99",
      "available":true
   },
   {
      "id":2,
      "name":"Avental",
      "description":"Jaleco de alta qualidade fabricado para atender aos clientes mais exigentes",
      "price":"R$ 999,99",
      "available":true
   },
   {
      "id":3,
      "name":"Touca",
      "description":"Jaleco de alta qualidade fabricado para atender aos clientes mais exigentes",
      "price":"R$ 999,99",
      "available":true
   },
   {
      "id":4,
      "name":"Fronha",
      "description":"Jaleco de alta qualidade fabricado para atender aos clientes mais exigentes",
      "price":"R$ 999,99",
      "available":true
   },
   {
      "id":5,
      "name":"Embalagem",
      "description":"Jaleco de alta qualidade fabricado para atender aos clientes mais exigentes",
      "price":"R$ 999,99",
      "available":true
   },
   {
      "id":6,
      "name":"Porta talher",
      "description":"Jaleco de alta qualidade fabricado para atender aos clientes mais exigentes",
      "price":"R$ 999,99",
      "available":true
   },
   {
      "id":7,
      "name":"Porta absorvente",
      "description":"Jaleco de alta qualidade fabricado para atender aos clientes mais exigentes",
      "price":"R$ 999,99",
      "available":true
   }
]
```

**Parameters**

Each operation has its own parameter, which corresponds to the product of the conversion: **JSON** for the **Convert CSV to JSON** operation and **CSV for the Convert JSON to CSV** operation. When used, they produce the resulting code, which can later be manipulated by the [**Data Transformation**](/english/skyone-studio/integrations/flows/tool-modules/data-transform-module.md) module or by using a [**SMOP**](/english/skyone-studio/integrations/flows/data-operations/smop-small-operations.md).

Both parameters will appear on the left-hand side of the configuration modal for each operation in the flow, as long as the operations are all connected by lines in the flow.

To finish configuring the module, click on "**Save**".

{% hint style="info" %}
[Find out about the Module Header here](/english/skyone-studio/integrations/flows/module-header.md).
{% 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.skyone.cloud/english/skyone-studio/integrations/flows/tool-modules/csv-module.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.
