Creating a CSV Data Structure
- 14 Feb 2022
- 2 Minutes to read
- Print
- DarkLight
This documentation version is deprecated, please click here for the latest version.
Creating a CSV Data Structure
- Updated on 14 Feb 2022
- 2 Minutes to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
Overview
Data Structures can be created from CSV data by using the default Data Editor in the Decisions environment. Once the new structure is created from CSV data, Flow steps can deserialize and serialize the data.
Note on Exporting CSV Data Structures [Database Stored]
CSV Data Structures [Database Stored] are saved to the database while CSV Structures are saved within Decisions as a Data Structure similar to Flow Structures. When exporting a CSV Data Structure [Database Stored], it does not transfer with data: only the structure itself exports. Data must be first exported with Flow logic or by the Import Data From CSV Action.
Configuration
The following settings are available upon creating a CSV Data Structure:
Create Types From CSV Settings | |
Read From File | Decisions will create the CSV data structure based on an uploaded file |
First Row Is Field Names | Decisions will read the first row of a CSV file as data structure column names |
Ignore Empty Rows | Decisions will not upload the empty rows in the CSV |
Separator | The type of separator that will be used to parse through the data. Comma is used by default. |
Create Database Table For Type | Stores the CSV type in a database table |
Example
- In a Designer Folder, select the CREATE DATATYPES/INTEGRATIONS button on the bottom Action Bar.
- Select the XML/JSON/CSV tab when the window appears.
- Choose Create Types from CSV and select CREATE.
- Enter a CSV Structure Name and the Namespace should automatically populate.
- Select the checkbox so that First Row Is Field Names, which is typically enabled since most CSV imports use header field names in the first row.
- Use the Separator drop down to indicate what kind of separator is used in the CSV, which is Comma by default.
- In the CSV Structure field, enter the header field name separated by a comma and nothing else on the first row.
- After the field names are defined, the CSV data can be pasted below them. Once the data is in this field, select CREATE.
- The Data Editor window will appear with the name of the header fields pre-populated into the Data Structure configuration. When the Data Structure is created, define the data fields.
- This example uses FName, LName, and Age- the same values used as field names in the CSV. All of the data underneath it in the CSV are values of these specific data fields, similar to the composition of a Data Structure.The Type drop down is used to correspond with the type of data that is expected for each data field. For example, Age could be a String value or an Int32 value. A total dollar amount would be a decimal value. Save the structure once configurations are complete.
- Back in the Designer Folder, select the CREATE FLOW button from the bottom Action Bar.
- Choose the default template and select CREATE.
- Name the Flow, then select CREATE again.
- In the Flow Designer, use the Steps tab and navigate to the User Defined Types > CSV Structures section, where the Deserialize and Serialize steps are available for this structure.
The deserialize option is to convert the structure into bytes, where the serialize option will do the opposite if new data is used to comprise the structure.
Was this article helpful?