Creating a CSV Data Structure
  • 14 Feb 2022
  • 2 Minutes to read
  • Dark
    Light
  This documentation version is deprecated, please click here for the latest version.

Creating a CSV Data Structure

  • Dark
    Light

Article summary

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 FileDecisions will create the CSV data structure based on an uploaded file
First Row Is Field NamesDecisions will read the first row of a CSV file as data structure column names
Ignore Empty RowsDecisions will not upload the empty rows in the CSV
SeparatorThe type of separator that will be used to parse through the data. Comma is used by default.
Create Database Table For TypeStores the CSV type in a database table



Example

  1. In a Designer Folder, select the CREATE DATATYPES/INTEGRATIONS button on the bottom Action Bar. 
  2. Select the XML/JSON/CSV tab when the window appears.
  3. Choose Create Types from CSV and select CREATE.

    2019-07-19_100540.PNG

  4. Enter a CSV Structure Name and the Namespace should automatically populate. 
  5. 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. 
  6. Use the Separator drop down to indicate what kind of separator is used in the CSV, which is Comma by default.
  7. In the CSV Structure field, enter the header field name separated by a comma and nothing else on the first row. 
  8. After the field names are defined, the CSV data can be pasted below them. Once the data is in this field, select CREATE.

    2019-07-19_101624.PNG

  9. 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.
  10. 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.

    2019-07-19_101701.PNG

  11. Back in the Designer Folder, select the CREATE FLOW button from the bottom Action Bar. 
  12. Choose the default template and select CREATE.
  13. Name the Flow, then select CREATE again.
  14. 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.

2019-07-19_102800.PNG



Was this article helpful?