Skip to main content

Generate file

This action allows you to construct files on the fly and let users download it. Presently, the only file type supported is CSV.

Options

OptionDescription
TypeType of file to be generated
File nameName of the file to be generated
DataData that will be used to construct the file. Its format will depend on the file type, as specified in the following section

Data format for CSV

For CSV file type, the data field should be supplied with an array objects. ToolJet assumes that the keys of each of these objects are the same and that they represent the column headers of the csv file.

Example:

{{
[
{ name: 'John', email: 'john@tooljet.com' },
{ name: 'Sarah', email: 'sarah@tooljet.com' },
]
}}

Supplying the above snippet will generate a csv file which looks like this:

name,email
John,john@tooljet.com
Sarah,sarah@tooljet.com