In this tutorial, you will be able to learn how to Merge Data Table in UiPath Studio. In this tutorial, we will guide you on to merge two data tables as a single data table in UiPath Studio. With the help of this activity, merging two data tables is much simpler and easier.

Here we will provide a complete step-wise guide with help of a real example so that the concepts of this activity are clear. So let’s go through this.

What is Merge Data Table in UiPath Studio

Merge Data Tables in UiPath is one of the activities that uipath provides. This activity is used to merge two or more data tables into a single data table. For example, if there exist two data tables “DataTable1” and “DataTable2” after using this activity all the values in both data tables will be combined into one data table.

Since we are merging two data tables each of them should have the same columns. The package used in this activity is UiPath.Core.Activities.MergeDataTable.

You have to provide both source and destination variables to merge different data tables. Below you can see a real example of using this activity in UiPath Studio.

How to Merge Two Data Tables in UiPath Studio

As now you have learned some basic ideas about this activity, let’s go in-depth with the help of a real example where we will create two data tables and merge them into a single, which will be displayed on a message box activity. The following steps can be taken to implement this activity:

  1. Open UiPath Studio and create a new process.
  2. Create two DataTable variables (DataTable1 and DataTable2) and a String variable (DataTable_Outptut).
Variable NameVariable TypeDefault Value
DataTable1 DataTable
DataTable2DataTable
DataTable_OutptutString
  1. Drag a Build Data Table activity into the workflow and create columns for each variable (Name, and Age) in DataTable1. In properties, the panel enters the data table name “DataTable1” in the Output Data table.
Name (String)Age (Int32)
Rock 22
Sam33
  1. Repeat step 3 for DataTable2 and enter the output variable (DataTable2) in the properties panel.
Name (String)Age (Int32)
Rahul26
Angelina25
  1. Now Drag and drop the Merge Data Table activity into the workflow. Now you have to add the Source and destination variables.
Merge Data Table Activity in UiPath Studio
Merge Data Table Activity in UiPath Studio
  1. In the Merge activity properties, add DataTable2 to the Source field and DataTable1 to the Destination field. Here we are merging all data in DataTable2 into DataTable1.
  2. Now all the data are in the “DataTable1” variable. So we want to convert this variable into a string. To do that add an Output Data Table activity and add “DataTable1 “to the DataTable field and “DataTable_Output” to the Text field.
  3. Now we have converted the datatype to string and stored it in the “DataTable_Output” variable.
  4. Now Drag and Drop the “Message Box” Activity and enter the variable “DataTable_Output” in the properties panel of the message box activity
  5. Now you have completed the workflow of the implementation of this activity. Now run this process and see how it gonna work. The complete workflow is given below
Merge data table example in uipath
Merge data table example in uipath
  1. After executing the process, the output will be shown in the message box activity. Now you can see both two data tables are merged into a single data table i,e “DataTable1”.
After merging Data Tables
After merging Data Tables

Properties of Merge Data Table UiPath Activity

Now, let’s check the properties panel of this activity. The properties of each activity can be seen on the right side of your uipath studio interface once you click on the activity.

PropertiesDescriptions
InputDestination: It specifies the variable where you want to store the final data table.
MissingSchemaAction:  It describes missing action schema while merging
Source: The source data table for merging.
CommonDisplayName 

Conclusion

As now you have learned the Merge data table example in uipath, you can use this activity on various use cases depending on your automation process. You can also use this on Excel sheets to merge two or more Excel sheets.

If you have any doubts about this activity, you can ask in the comment section. Also, refer UiPath Docs.

Faq on Merge Data Table Activity

  1. How do I merge two data tables in UiPath?

    To merge two Data Tables in UiPath Studio, you can use the u0022Merge Data Tableu0022 activity and enter the source and destination datatable for merging.

  2. How do I combine data in DataTable?

    To combine data in a data table you can use u0022Merge Data Table Activityu0022

  3. How do I merge two columns in DataTable?

    To merge Two columns in Data Table you can use u0022Merge Data Table Activityu0022 in UiPath Studio.