Creating a CSV Data Structure
  • 27 Jun 2024
  • 2 Minutes to read
  • Dark
    Light

Creating a CSV Data Structure

  • Dark
    Light

Article summary

Data Structure Quick Summary
Complexity?Performance Impact?Saves to Database?Configuration Folder?Entity Framework?Folder Behavior?Process Tracking?
LowLowYesNoNoNoNo

Overview

Data Structures can be created from CSV data and can be deserialized and serialized using pre-built Flow steps. 

Exporting CSV Data Structures [Database Stored]
CSV Data Structures [Database Stored] are saved to the database while CSV Data 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.

Example

  1. In a Designer Project, select the CREATE DATATYPES/INTEGRATIONS button on the top action bar. Select XML/JSON/CSV and select Create Types from CSV.
  2. Enter a name in the CSV Structure Name field. The Namespace will automatically be populated. 
  3. Select the First Row Is Field Names checkbox this is typically enabled since most CSV imports use header field names in the first row. 
  4. Use the Separator dropdown to indicate what kind of separator is used in the CSV. 
  5. In the CSV Structure field, enter "FName,LName,Email" as header field names separated by a comma. After the field names are defined, the CSV data can be pasted below them. Click CREATE.
    Setting NameDescription
    Read From FileCreates the CSV data structure based on uploaded CSV file
    First Row Is Field NamesReads the first row of the uploaded CSV file as Data Structure column names
    Ignore Empty RowsIgnores empty rows found in the CSV file
    SeparatorPrompts specification of separator for parsing through data
    Create Database Table For TypeStores the CSV type in a database table
  6. The Edit Defined Data Structure window will appear and display the header fields' names pre-populated into the data structure configuration. Click SAVE to create the Data Strucuture.

CSV Data Structure Steps

After a CSV Data Structure is created, the Deserialize From CSV and Serialize To CSV steps will be available in the Toolbox panel by navigating to USER DEFINED TYPES > CSV STRUCTURES > [NAME OF CSV STRUTCTURE].

Deserialize From CSV

The Deserialize From CSV step converts the data structure from a single serialized string into a more human-readable output with columns and values. 

Setting NameDescription
File TypeDefines the file type of the input file (CSV, Excel, AutoSelect)
Worksheet Index (displays if Excel file type is selected)Defines the starting point of the data
SeparatorDefines the character separator in the input file for each data field
Skip First RowSkips the first row in the input file
Ignore Empty RowsEmpty rows will be ignored
Input FileDefines the input file 

Serialize To CSV

The Serialize To CSV step takes in the CSV data and serializes it into one string.

Setting NameDescription
File TypeDefines the file type of the output file (CSV, Excel, AutoSelect)
SeparatorDefines the character separator in the input file for each data field
Include Field NamesIncludes the defined field names in the output string


For further information on Data Structures, visit the Decisions Forum.

Was this article helpful?