Generate files

Create custom CSV, TXT or PDF files

Generate file

There are multiple blocks to create different types of files, PDF, CSV and Custom files like txt or json. These file builders will return the file in the File type out-pin. You can use this pin to download the file, create an attachment for an Email you want to send, or attach it to a document in a storage.

build_files.png

Build PDF

The file: build PDF exists of three sections per page, The header, The body and The footer. The header and footer will not show unless you give it height. A recommended height for both the header and footer is something around the 100px. You will see that the content in the header has some margin to the top of the page, you can resolve this by adding margin-top: -30px to the first element of the header.

In the body you can put the content you want to use. This is made with the uicomponents actions. The PDF does not use the bootstrap classes used by some of the actions. You will have to solve the styling using the style pins.

The build PDF has some extra options you can set to format the pages being used. format can be used to set the page type (A1, A2, A3, etc). When you fill the format pin, you won't be able to use the width and height pins. These have the same function as the format, but you can specify the size to your liking. is landscape when set to true, all the pages in the pdf will be shown in landscape mode instead of portrait.

build_pdf.png

Build CSV

The Build CSV uses two in-pins to create the content of the CSV, the Headers, an array of values which contains the field you want to use in the CSV. The Values, an array with objects which will have the data for your CSV, the values in the header will search the fields in the objects and places them in the right column.

build_csv.png

Custom txt example

When you want to create a file that has not its own action, you might be able to create it with the file: generate from value. With this action you can create, txt, json, or any extension you can create using values. A simple example is the txt extension. Using this you can create a text file. The only thing you have to do is fill the Data. See the example to the right.

build_custom_txt.png

Custom JSON example

Just like the txt extension, you can use the json extension. In the file: generate from value you still need to enter a value type. You can convert any array with object with the JSON Stringify this will return a stringified value from the array which you can use in the data.

build_custom_json.png