---
title: TO_CSV
url: https://www.tines.com/docs/formulas/functions/to-csv/
kind: formula-function
---

*[tines.com](https://www.tines.com/llms.txt) › [Docs](https://www.tines.com/docs/llms.txt) › [Formulas](https://www.tines.com/llm/docs/formulas.md) › [Functions](https://www.tines.com/llm/docs/formulas/functions.md)*

# TO_CSV

*[View on tines.com](https://www.tines.com/docs/formulas/functions/to-csv/)*

Convert an array of arrays into CSV-formatted text.

**Categories:** Data Parsing/Conversion

## Syntax

```
TO_CSV(array_of_arrays)
```

## Examples

### Example 1

Input:

```json
{
  "my_action": [
    [
      "city",
      "state"
    ],
    [
      "Melbourne",
      "VIC"
    ],
    [
      "Sydney",
      "NSW"
    ],
    [
      "New York City",
      "NY"
    ],
    [
      "Los Angeles",
      "CA"
    ]
  ]
}
```

Formula:

```
TO_CSV(my_action)
```

Output:

```json
"city, state\nMelbourne, VIC\nSydney, NSW\n\"New York City\", NY\n\"Los Angeles\", CA\n"
```

### Example 2

Formula:

```
TO_CSV([[1, 2], [3, 4], [5, 6]])
```

Output:

```json
"1, 2\n3, 4\n5, 6\n"
```

## Sample actions

```json
{
  "standardLibVersion": "13",
  "actionRuntimeVersion": "1",
  "agents": [
    {
      "disabled": false,
      "name": "My Action",
      "description": "",
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": [
          [
            "city",
            "state"
          ],
          [
            "Melbourne",
            "VIC"
          ],
          [
            "Sydney",
            "NSW"
          ],
          [
            "New York City",
            "NY"
          ],
          [
            "Los Angeles",
            "CA"
          ]
        ]
      },
      "position": {
        "x": 930,
        "y": 3390
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "form": null
    },
    {
      "disabled": false,
      "name": "TO_CSV",
      "description": "",
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": {
          "to_csv": "=TO_CSV(my_action)"
        }
      },
      "position": {
        "x": 930,
        "y": 3495
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "form": null
    }
  ],
  "links": [
    {
      "sourceIdentifier": 0,
      "receiverIdentifier": 1
    }
  ],
  "diagramNotes": []
}
```
