activities
latest
false
UiPath logo, featuring letters U and I in white

Workflow Activities

Last updated Dec 20, 2024

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 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

       
  3. Drag a Build Data Table activity inside the Sequence container.

    • In the Properties panel, add the variable DT1 in the DataTable field.
  4. 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:



  5. 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.
  6. Place a Write Line activity below the Output Data Table activity.

    • Add the variable DataTableString in the Text field.
  7. 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.
  8. Place a Write Line activity below the Output Data Table activity.

    • Add the variable Name in the Text field.
  9. Drag a Clear Data Table activity underneath the Write Line activity.

    • In the Properties panel, add the variable DT1 in the DataTable field.
  10. 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.
  11. 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.
  12. Place a Write Line activity below the Lookup Data Table activity.

    • Add the variable DataTableString in the Text field.
  13. Place a Write Line activity below the previous Write Line activity.

    • Add the variable Name in the Text field.
  14. 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:



Here you can download an example.

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.