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.
Table of Contents
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
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:
- Open UiPath Studio and create a new process.
- Create two DataTable variables (DataTable1 and DataTable2) and a String variable (DataTable_Outptut).
|Variable Name||Variable Type||Default Value|
- 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)|
- Repeat step 3 for DataTable2 and enter the output variable (DataTable2) in the properties panel.
|Name (String)||Age (Int32)|
- Now Drag and drop the Merge Data Table activity into the workflow. Now you have to add the Source and destination variables.
- 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.
- 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.
- Now we have converted the datatype to string and stored it in the “DataTable_Output” variable.
- Now Drag and Drop the “Message Box” Activity and enter the variable “DataTable_Output” in the properties panel of the message box activity
- 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
- 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”.
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.
|Input||➊ Destination: 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.
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
How do I merge two data tables in UiPath?
To merge two Data Tables in UiPath Studio, you can use the “Merge Data Table” activity and enter the source and destination datatable for merging.
How do I combine data in DataTable?
To combine data in a data table you can use “Merge Data Table Activity”
How do I merge two columns in DataTable?
To merge Two columns in Data Table you can use “Merge Data Table Activity” in UiPath Studio.