Merge Data Tables Snippet
The Merge Data Tables snippet lets you merge data from multiple data sets into a single grid. The snippet includes configuration for three types of merges:
Intersection: Combines all table values that share the same key.
Inner: Combines all table values that share the same key. Unlike the Intersection feature, the Inner feature also lets you add one table's values to the other table.
Outer: Separates values from one table that don't share the same key as the other table.
Because the snippet contains configuration for each type of merge, you can use the merge type applicable to your use case then remove the rest.
Here's how the snippet looks in Express View:
And here's how the snippet looks in the Module Builder:
What You'll Learn
In this article you'll learn:
- How the Merge Data Table snippet works.
- How to configure the Merge Data Table snippet.
When you open up the snippet in Module Builder, you'll see 3 Panels that include configuration for each merge type. The only difference in their configurations is their Data Workflows.
The image below shows the configuration of the Intersection Data Workflow. Both Data Tables are used as inputs. The Merge operator merges the tables and outputs the data into the new Data Table. The other two Data Workflows are the same, but with different Merge Types.
Setting Up the Snippet
For this snippet to function correctly, you need to make a few adjustments. You'll first remove the configuration for any of the Merge Types you don't need. You'll also replace the sample data with your own. This snippet comes with 2 Data Tables of sample data:
These are placeholders. You can either update the data in these tables or remove them and connect different Data Tables to the Data Workflow.
Inputting New Data Tables
To merge data from different Data Tables, update the Input operator in the Data Workflow. You'll select the new Data Table from the operator's Component drop-down. In the image below, the snippet is updated to merge new Data Tables.
Inputting API Data
You can similarly update the Input nodes to merge API data or a combination of API and non-API data. In the Component drop-down select the component that stores your API data. For ways to convert your API data into a Data Table, reference the Object2Table Operator documentation.
There are many ways you can input API data into your module. For more information about getting API data, reference Unqork's API documentation.