UiPath Activities

The UiPath Activities Guide

Add Data Row/Column

The example below explains how to build a DataTable with columns and rows by using the Add Data Row, Add Data Column, and Output Data Table activities. You can find these activities in the UiPath.System.Activities package.

This is how the automation process can be built:

  1. Open Studio and create a new Process.
  2. Drag a Sequence container in the Workflow Designer.
    • Create the following variables:
Variable Name
Variable Type
Default Value

DT1

DataTable

new DataTable

ArrayOfValues

System.String[][]

{({"A1","John","6"}),({"A2","Jamie","3"}),({"A3","Jim","9"}),({"A4","Janice","5"})}

DataTableString

String

TableHeaders

System.String[]

{"Id","Name","Grade"}

  1. Drag a For Each activity inside the Sequence container.
    • Add the value header in the ForEach field.
    • In the Properties panel, select the String option from the TypeArgument drop-down list.
    • Add the variable TableHeaders in the Values field.
  2. Place an Add Data Column activity inside the For Each activity.
    • In the Properties panel, add the value header in the ColumnName field.
    • Add the variable DT1 in the DataTable field.
    • Select the String option from the TypeArgument drop-down list.
    • Select the check box for the AllowDBNull option.
    • Add the value 100 in the MaxLength field.
  3. Drag a For Each activity below the previous For Each activity.
    • Add the value row in the ForEach field.
    • In the Properties panel, select the System.String[] option from the TypeArgument drop-down list.
    • Add the variable ArrayOfValues in the Values field.
  4. Place a Add Data Row activity inside the For Each activity.
    • In the Properties panel, add the value row in the ArrayRow field.
    • Add the variable DT1 in the DataTable field.
  5. Drag a Output Data Table activity below the last For Each activity.
    • In the Properties panel, add the variable DT1 in the DataTable field.
    • Add the variable DataTableString in the Text field.
  6. Drag a Write Line activity underneath the Output Data Table activity.
    • Add the variable DataTableString in the Text field.
  7. Run the process. The robot creates the DataTable by adding columns and rows.
  8. This is how your workflow should look:

Updated 13 days ago


Add Data Row/Column


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.