UiPath Activities

The UiPath Activities Guide

Manage DataTables

The example below explains how to create and print a data table, look up the specified value, clear and print the data table by using activities such as Build Data Table, Output Data Table, Clear Data Table, and Lookup Data Table. 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

-

Name

GenericValue

-

DataTableString

String

-

  1. Drag a Build Data Table activity inside the Sequence container.
    • In the Properties panel, add the variable DT1 in the DataTable field.
  2. Click the DataTable button from the Build Data Table activity.
    • Click the Add Column button and add a new column.
    • Click the Edit Column button from the first column and add the value Name in the ColumnName field.
    • Select the String option from the Data Type drop-down list.
    • Select the check box for the Allow Null option.
    • Add the value -1 in the Max Length field.
    • Click the OK option for closing the window.
    • Click the Edit Column button from the second column and add the value Surname in the ColumnName field.
    • Select the String option from the Data Type drop-down list.
    • Select the check box for the Allow Null option.
    • Add the value -1 in the Max Length field.
    • Click the OK option for closing the window.
    • Click the Edit Column button from the third column and add the value Grade in the ColumnName field.
    • Select the Int32 option from the Data Type drop-down list.
    • Select the check box for the Allow Null option.
    • Add the value -1 in the Max Length field.
    • Click the OK button for closing the window.
    • Click the OK button again.
    • This is how the DataTable window should look:
  1. Drag an Output Data Table activity below the Build Data Table activity.
    • In the Properties panel, add the variable DT1 in the DataTable field.
    • Add the variable DataTableString in the Text field.
  2. Place a Write Line activity below the Output Data Table activity.
    • Add the variable DataTableString in the Text field.
  3. Drag a Lookup Data Table activity below the Write Line activity.
    • In the Properties panel, add the variable DT1 in the DataTable field.
    • Add the value "10" in the LookupValue field.
    • Add the value "Grade" in the ColumnName field.
    • Add the value Name in the CellValue field.
    • Add the value Name in the ColumnName field.
  4. Place a Write Line activity below the Output Data Table activity.
    • Add the variable Name in the Text field.
  5. Drag a Clear Data Table activity underneath the Write Line activity.
    • In the Properties panel, add the variable DT1 in the DataTable field.
  6. Drag an Output Data Table activity below the Clear Data Table activity.
    • In the Properties panel, add the variable DT1 in the DataTable field.
    • Add the variable DataTableString in the Text field.
  7. Drag a Lookup Data Table activity below the Output Data Table activity.
    • In the Properties panel, add the variable DT1 in the DataTable field.
    • Add the value "10" in the LookupValue field.
    • Add the value "Grade" in the ColumnName field.
    • Add the value Name in the CellValue field.
    • Add the value Name in the ColumnName field.
  8. Place a Write Line activity below the Lookup Data Table activity.
    • Add the variable DataTableString in the Text field.
  9. Place a Write Line activity below the previous Write Line activity.
    • Add the variable Name in the Text field.
  10. Run the process. The robot creates and prints the data table, looks up the specified value, clears and prints the data table.
    • This is how your workflow should look:

Updated about a month ago


Manage DataTables


Suggested Edits are limited on API Reference Pages

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