This function imports the contents of a CSV file into a Table. Click here for more information on CSV files.
Once the file contents are imported, you can process the data in a variety of ways, including using the Search Rows function to retrieve a single row, a subset of rows, or all the rows, and process the rows one by one using a List function such as For Each.
Important note: This function will soon be enhanced with additional options, including the ability to specify the separator value.
Options
The first step for using this function is to provide the Table to import the csv. Click the “Choose Table” button and select the table you want to use.
If your Flow will operate on different tables each time, you can choose the advanced option to “provide table at runtime“ which will result in an additional Table input field on the next step.
Inputs
- Destination
- Table ID (text) - the UUID for the table to import to. Only shown if you selected “provide table at runtime” at the Options step
- Source
- File Content (file) - the File ID of the file to import from. Must be a correctly-formatted CSV file.
- Options
- Select (list of text) - A list of column names to directly import into your table. Use this input when the CSV column names are exact matches of their counterparts inside of your destination table. Example- if my CSV file has a column header named “Column 1”, and the column I would like that information imported to in my table is also named “Column 1”, I would make sure to place “Column 1” in this list. However, if your mappings between the CSV and the table are more complex, use the “Mapping” input below, and leave this input blank.
- Mapping (object) - An object describing the mapping between my CSV’s column names, and the column names of the table I’m importing that information into. To build this object, make sure all keys are the name of the column header in your CSV file, and your table’s column names are its corresponding value. If a CSV column header is not mapped, it will not be imported into your table. Example- I have a CSV with two column headers called “Column 1” and “Column 2”. I would like all data in “Column 1” to be mapped to my table column “Column A”. I do not want to include any information from “Column 2” in my table. My “Mapping” object would look like so: {“Column 1” : “Column A”}, and would omit “Column 2” entirely.
- Delimiter (string) - Enter a custom delimiter for your CSV file. For example, if you are using a pipe delimited csv file, then you would want to enter
|
as your delimiter. Defaults to,
. - Clear Destination (true/false) - set to true if you want to delete all existing rows from the table before importing the file. Otherwise, it will append the new file data onto the end of the table.
Outputs:
- New Rows (number) - the number of rows imported.