Skip to main content

One post tagged with "howtomergedatatable"

View All Tags

How to merge two data table?

· 2 min read
Selin Gizem Özkan
RPA Developer

Data analysis often involves working with multiple datasets and the need to merge them into a cohesive and comprehensive structure. Merging data tables is a fundamental operation that allows us to combine information from two separate tables based on common attributes.

In this guide, we will explore how to merge two data tables using the powerful 'Merge Table' node available in the Data Table package.

The 'Merge Table' node acts as the key component in this process, taking two distinct objects as input and returning a unified, combined object as output.

How to Setup?

To begin, Log in to your Robomotion workspace. If you haven't registered yet, you can create your workspace from the provided link.

About Data Table Package

DataTable package uses Pandas DataFrame library for performing table operations. It consists of 19 nodes that offer a wide range of powerful functionalities, enabling you to efficiently manipulate and analyze data.

What is the Merge Table node?

This node is designed to combine two data tables based on specified columns, facilitating the integration of information from different datasets.

You can use the 'Merge Table' node in the Data Table package to perform this operation. This node takes 2 objects as input. Returns the combined object as output. As options are passed are by reference or by value.

Merge Table node options

Flow Steps

  1. The Inject node is used to initialize the flow.
  2. Install the data table package.
  3. Two objects are defined using a 'function' node

Function Node Named 'Set Table':

Code-Block:

msg.table_one = {
columns: ["Name", "Surname", "Age"],
rows: [{
Name: 'Jack',
Surname: 'Smith',
Age: 21
},
{
Name: 'Harry',
Surname: 'Brown',
Age: 30
},
{
Name: 'Charlie',
Surname: 'Wilson',
Age: 50
}
]
};

msg.table_two = {
columns: ["City"],
rows: [{
City: 'Brighton'
},
{
City: 'Oxford'
},
{
City: 'Liverpool'
}
]
};

return msg;

  1. Two tables are provided as input to the 'Merge Table' operation, resulting in a combined table as the output
  2. See the output of the created table using the debug node..

Merge table Flow