List to CSV Mapping
  • 06 Dec 2023
  • 3 Minutes to read
  • Dark
    Light

List to CSV Mapping

  • Dark
    Light

Article summary

Step Details

Introduced in Version---
Last Modified in Version8.17.0
LocationData > Excel & CSV

The List to CSV Mapping step can be used to populate a CSV or Excel File with data from a list. 

This article describes all the Step Properties and the usage of Mapping Editor to pass the data from a user-defined data type to generate a CSV or EXCEL file.



Properties

Input Data

This will allow to configure the file that the step will output.

PropertyDescriptionData Type
Output File TypeDefines the type of file the step will output. Currently, the options are CSV, Excel_xls, Excel_xlsx, and AutoSelect.
Note: Autoselect defaults to CSV.
--
CSV DelimiterAllows configuring the separator to be used for the CSV row.--
Output Header RowEnabling this property exposes a new setting: Fields under the INPUTS section in the Properties panel. This gives users access to adding a header row and configuring the formatting of the text defined in the header.Boolean
Header Row NumberDetermines which row the headers are placed on in the file.Int32
Start Data On RowDetermines which row the data begins on the file.Int32
Load TemplateEnabling this property gives users access to the Template Inputs.Boolean
Worksheet IndexDetermines the sheet number where the values should be presented. The index of the worksheet starts from 0.
Note: Only applicable for .xls and .xlsx file types.
Int32
Quotation Mark BehaviorThis will allow users to specify when to include quotation marks (") for CSV values. E.g., the list contains a comma,
  • Always Quote: All values will be quoted always
  • Quote If Special Chars Present: All values that contain special characters, such as quotation marks and separator characters, will be quoted. It is the same behavior as MS Excel for exporting text files.
  • Quote Only If Needed: Only quote values when needed. For example, if one value contains a quotation mark, but the quotation mark is not at the beginning of this value, this value will not be quoted.
  • Never Quote: All values will not be quoted. The exported text file with this type may not be read back correctly because the needed quotation marks are absent.
--

INPUTS

This will enable the definition of the input data to be passed.

PropertyDescriptionData Type
INPUTSList of Objects to add to the CSV file. Users have the flexibility to pass any user-defined data type to this property. This allows adding multiple fields (columns) to the CSV or Excel file. This can be achieved by mapping additional fields via the mapping editor.

Note: It is mandatory to map input data using the Show Item Mapping Editorin the step properties located above the search bar. For more information, refer to the next section of this article.
List of String
FieldsAllows to define the formatting of the header.---

Is BoldFormats the text in Bold. ---

Percent Increase in Font SizeIncreases the size of the Header text in percentage.---

Title SetupDefines the text shown in the header row. ---

Column WidthDefines the width of the Column containing the Header Row.---
TemplateDefines the formatting of the new CSV file to follow the same formatting of this template.FileData

Outputs

PropertyDescriptionData Type
Outcome FileFile created when the Flow executes this step successfully.FileData



Using the Mapping Editor 

As mentioned in the above section (under INPUTS), the step accepts the input type as "List of String," but users can pass any user-defined data type to this property. The following section demonstrates how to map the user-defined data type by adding multiple fields.

  1. From the Toolbox, Add a GetAll step from any of the User-Defined Types and join it to the 'List to CSV Mapping Step'.
  2. From the Properties Panel, navigate to the INPUTS of the 'List to CSV Mapping Step'. 
  3. Choose the mapping type 'Select From Flow'. Click on 'Edit' and pick the data as the output of the GetAll step (Results). Click on Done.
  4. Click on the 'Show Item Mapping Editor' from the properties panel located above the search bar. A Mapping Editor screen appears with two sections: 
    1. FLOW DATA: This section shows all the inputs available within the Flow.
    2. STEP INPUTS: This section allows configuring the number of fields to be added in CSV or EXCEL.
  5. From the STEP INPUTS section, expand the Inputs, change the mapping type of ITEM to Build Data, and click on the Pencil icon to add the number of fields. This defines the number of columns that will be generated in the output file. 
  6. From the FLOW DATA, expand the __INPUT and map the fields to the newly added fields. Mapping is done by clicking and dragging action, generating a blue-dotted line showing the value passed from __INPUT to the added Fields.
  7. Click OK and Debug the Flow. Data from the User-Defined type will be passed to the respective fields.

Feature Changes

DescriptionVersionDeveloper Task
Added the ability to define the Behavior of Quotation Marks for CSV file type.8.17[DT-038734]


Related Information

Example Lab:
Using List To CSV Mapping Step

Forum Posts:
How Do I Use The List To CSV Mapping Step?
Number Of Fields On List To CSV Mapping Step
List To CSV Mapping Step, Excel Numbers



Was this article helpful?