"Merge Data Table" activity

Created by akaBot Support, Modified on Thu, 21 Nov, 2024 at 10:52 AM by akaBot Support

Activity program nameAbout the "Merge Data Table" Activity

The "Merge Data Table" activity allows merging two data tables. Below is an explanation of its features and usage.


TABLE OF CONTENTS


1. Activity program name

RCA.Activities.Core.MergeDataTable


2. Description

  • For Studio version up to 2.0.2.0:
    Quick access: Toolbox > Data Table > Merge Data Table

  • For Studio version 2.0.3.0 and later:
    Quick access: Toolbox > Core > Data Table > Merge Data Table

This activity is used to merge two data tables.

  • Verified working version: 2.2.0.2

Note: Some labels and behavior may differ depending on the version.


3. Properties


Property itemProperty name
Input fieldDescription
Options

Action when schema is missing

Dropdown

Selects how to handle merging when column definitions differ:


Add: Includes all columns from both the source and destination tables.

Ignore: Ignores columns that exist only in the source table.

Error: Throws an error if the source and destination column definitions differ.

AddWithKey: Includes all columns from both tables and adds primary key information to column definitions.

OtherPublicCheckbox

If checked, logs data so it can be viewed through logs. Be cautious when handling sensitive information.

Display Name

Enter value (String type)

Reflected as the activity name in the designer panel.

InputSource

Enter value (DataTable type)

Specifies the source data table to be merged into the destination table.

Destination

Enter value (DataTable type)

Specifies the destination data table where the source data will be merged.


4. Usage (when column definitions are the same)

If the two data tables to be merged have the same column definitions, the source table’s data is appended to the destination table.

Example:

Create a data table using the Build Data Table activity, e.g., rateTable.

Add a second data table, e.g., addRateData, with the same column definitions.

Drag and drop the Merge Data Table activity into the designer panel.

In the properties, assign:

  • SourceaddRateData (the table to be added).

  • DestinationrateTable (the table to which data will be added).

Run the process. Data from addRateData is appended to rateTable.

To verify the output of the merged data table:

  • Use the Output Data Table activity to convert the data table to a string.

  • Display the string in the output panel using the Write Line activity, or show it in a message box by iterating through rows using the For Each Row activity.


In the example: The merged content will appear in the rateTable variable, which combines the original rateTable data with the data from the source table addRateData.

5. Usage (when column definitions differ)

If the column definitions of the two data tables differ, the result of the merge depends on the Action when schema is missing property.

Examples:

  1. Destination Table:

Employee ID

Name

Department

0001

Robot001

Finance

  1. Source Table:

Employee ID

Name

Location

0002

Robot002

Headquarters


When the property value is "Add":

  • Includes all columns from both tables.

  • Missing values are filled with default values (if defined) or Null.



Employee ID

Name

Department

Location

0001

Robot001

Finance


0002

Robot002


Headquarters


When the property value is "Ignore":

  • Ignores columns that exist only in the source table.

Employee ID

Name

Department

0001

Robot001

Finance

0002

Robot002



When the property value is "Error":

  • Throws an error if column definitions differ.

  • No data is merged in this case.



Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article