> For the complete documentation index, see [llms.txt](https://docs.zbrain.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zbrain.ai/zbrain-documentation/zbrain-builder/flows/flow-components/csv.md).

# CSV

ZBrain CSV component guide to efficiently load and use CSV data in AI Agent workflows for structured and streamlined automation.

CSV (Comma-separated Values) is a simple file format used to store tabular data, such as a spreadsheet or database. In a CSV file, each line of text represents a row of data, and values within each row are separated by commas (or sometimes other delimiters like semicolons or tabs).

### **How to Connect CSV to ZBrain Flow?** <a href="#how-to-connect-csv-to-zbrain-flow" id="how-to-connect-csv-to-zbrain-flow"></a>

**Step 1: Select CSV as Your Connection**

* Click on the '+' button in the Flow and search for CSV.
* Select CSV.
* Decide on the action you need. ZBrain Flow provides two options:
  * **Convert CSV to JSON** – Converts a CSV string into a JSON array.
  * **Convert JSON to CSV** – Converts a JSON array into CSV format.

### **How to convert CSV to JSON?** <a href="#how-to-convert-csv-to-json" id="how-to-convert-csv-to-json"></a>

**Step 1: Enter Your CSV Data**

In the ‘CSV Text’ field, paste or input your CSV content. This is the CSV data you want to convert into JSON format.

**Step 2: Configure Headers Setting**

Select whether your CSV data includes headers in the ‘Does the CSV have headers?’ dropdown.

**Step 3: Specify the Delimiter Type**

From the ‘Delimiter Type’ dropdown, select the character that separates values in your CSV:

* **Comma (,) -** most common CSV format
* **Tab -** tab-separated values

### **How to convert JSON to CSV?** <a href="#how-to-convert-json-to-csv" id="how-to-convert-json-to-csv"></a>

**Step 1: Enter Your JSON Array**

In the ‘JSON Array’ field, input your JSON data. The input must be a valid JSON array containing objects.

**Step 2: Specify the Delimiter Type**

From the ‘Delimiter Type’ dropdown, select the character that will separate values in your CSV output:

* **Comma** - standard CSV format using commas to separate values
* **Tab -** tab-separated values


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.zbrain.ai/zbrain-documentation/zbrain-builder/flows/flow-components/csv.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
