ReadCSV

Estimated reading: 4 minutes 1834 views

This activity helps the user to read and extract data from the specified CSV file. It is helpful when you want to extract the data in tabular format for further processing with Excel automation feature. 

Properties

INPUT

Delimiter: This parameter refers to a character used to separate values in a CSV file. Select the delimiter from the drop-down menu:

Comma (,): Use this when the data in the input sheet is separated by commas.
Tab: Use this when the data in the input sheet is separated by tabs.
Semicolon (;): Use this when the data in the input sheet is separated by semicolons.
Pipe (|): Use this when the data in the input sheet is separated by pipes.
Caret (^): Use this when the data in the input sheet is separated by carets.

Filepath:* This parameter requires you to provide the path of the CSV file to execute the activities.

Datatype: This parameter accepts input values in the “String” datatype.
Browse Option: You can browse and select the file using the “Browse” option in the activity.
Manual Entry: Alternatively, you can either hardcode the input value in “String” format or manually provide the values in “String” datatype.

Hasheader: If this option is enabled, the first row in the specified CSV file will be treated as the header. If it is not enabled, the first row will not be considered a header.

MISC

DisplayName: Displays the name of the activity. The activity name can be customized, which aids in troubleshooting.

SkipOnError: Specify the “Boolean” value as “True” or “False.”

True: Continue executing the workflow regardless of any errors thrown.
False: Halt the workflow if it encounters any errors.
None: If the option is left blank, the activity will, by default, behave as if “False” were chosen.

Version: It indicates the version of the feature being used.

OUTPUT

ReadData:* This parameter retrieves the output of the activity as extracted data in “DataTable” format. It returns the values in the “DataTable” datatype.

Result: It provides the ability to view the execution status of the activity. It returns values in “Boolean.”

True: Indicates that the activity has been executed successfully without any errors.
False: Indicates that the activity has been unsuccessful due to an unexpected error being thrown.

*Represents mandatory fields to execute the workflow

Here’s an example of how the activity is used in the workflow –

In the following steps, I have utilized a sample CSV file which contains a list of customer details extracted from the organization’s website. Using this activity, we are going to read the value from the CSV file and extract them in a tabular format.

1. Create a new solution.
2. Install the feature “CSV Automation” from the manage features option.
3. Now, add the “ReadCSV” activity into the workflow.
a. This activity helps the user to read and extract the data in the CSV file in tabular format.
b. Navigating to the “Datatable” in the properties to declare a variable to view the output.
   i. There are two ways to create a variable –
   ii. Method 1 – Click on the “Datatable” property within the “ReadRanges” activity and enter the variable name. In this case, we are using “Table.” Then, press “Ctrl+Q,” which is a shortcut key to create a variable.
   iii. Method 2 – Click on the Variables pane and enter the name ” Table.” Then, in the “Variable Types” column, select “Browse for Types” from the dropdown menu.
   iv. The .Net window for data types will appear on the screen, enter the type of datatype as “System.Data.Datatable” and then click “OK” button.
5. Next, add the “Table viewer” activity to view the extracted output.
a. Add the input table value as “TABLE”.
b. Provide a title for the table.
6. Save and execute the workflow.

Share this Doc

ReadCSV

Or copy link

CONTENTS