> ## Documentation Index
> Fetch the complete documentation index at: https://docs.odella.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Table to File Block

> Convert tabular data into a CSV file

## Overview

The Table to File Block converts tabular data into a CSV (Comma-Separated Values) file. This block is particularly useful when you need to export data from your flow in a widely compatible format for further analysis or sharing.

<Frame>
  <img src="https://mintcdn.com/odella/PGZ7enNCqh0mvwj_/block-reference/assets/table_to_file_light.png?fit=max&auto=format&n=PGZ7enNCqh0mvwj_&q=85&s=5202b208381cda52f39b6d6814fbbda1" alt="Table to File Block Screenshot" className="block dark:hidden" width="682" height="306" data-path="block-reference/assets/table_to_file_light.png" />

  <img src="https://mintcdn.com/odella/PGZ7enNCqh0mvwj_/block-reference/assets/table_to_file_dark.png?fit=max&auto=format&n=PGZ7enNCqh0mvwj_&q=85&s=cea743dbe2ffe9a6fc24eaa6b67e9b41" alt="Table to File Block Screenshot" className="hidden dark:block" width="698" height="326" data-path="block-reference/assets/table_to_file_dark.png" />
</Frame>

## Inputs

<ParamField path="table" type="table" required>
  The table to convert. The input will be coerced to a table format if needed.
</ParamField>

## Outputs

<ResponseField name="file" type="file">
  The converted file output in CSV format.
</ResponseField>

<ResponseField name="duration" type="number">
  The time taken to process the conversion in milliseconds.
</ResponseField>

## Editor Settings

<ParamField path="formats" type="string[]" default={["csv"]}>
  The output file formats to generate. Currently only supports CSV format.
</ParamField>

## Example: Exporting a Table to CSV

1. Add a Table to File block to your flow.
2. Connect your input table to the `table` input of the Table to File block.
3. Run your flow. The block will output a CSV file containing your table data.

<Frame>
  <img src="https://mintcdn.com/odella/63rQpScaEp0bDpCd/images/table-to-file-example.png?fit=max&auto=format&n=63rQpScaEp0bDpCd&q=85&s=bda72c2588f30a969171f68de16389ea" alt="Table to File Example" width="2482" height="1522" data-path="images/table-to-file-example.png" />
</Frame>

## Error Handling

The block will error if:

* No Docme endpoint is configured in settings
* The input table is invalid or cannot be coerced to a table format

<Warning>
  Ensure that the input table data is properly structured and that your environment is correctly configured with a Docme endpoint.
</Warning>

## FAQ

<AccordionGroup>
  <Accordion title="What file formats are supported?">
    Currently, the Table to File block only supports CSV (Comma-Separated Values) format. Additional formats may be added in future updates.
  </Accordion>

  <Accordion title="How does the block handle data type conversion?">
    The block will attempt to coerce the input data into a table format if it's not already in the correct format. This provides flexibility in handling different input data structures.
  </Accordion>
</AccordionGroup>

## See Also

* [Table Block](/block-reference/loaders/read-table)
* [File Block](/block-reference/data/file)
* [Draft Block](/block-reference/draft/draft)
