JoinData

Joins data list b onto data list a, given a set of conditions and target path.

The JoinData node helps you to join two lists based on a set of conditions, e.g. to join

  • Facebook Insights and Ads based on the ad id
  • Facebook Adsets and Campaigns based on the campaign id
  • two Facebook Insights for different timeframes based on the ad object id
  • or whatever else you wish ✨
 
Notion image

How to use the JoinData node

 

Connect your main list to socket a and your second list to socket b. In order to configure HOW the data is joined, you need to specify the following settings:

  • conditions
  • target

The JoinData node works similar to how the “LEFT JOIN” statement in SQL works.

Conditions

The most important to determine how the two lists should be joined is the conditions part. For example if you want to join data at the ad level, you may choose the ad id as the only condition. E.g. if you want to join Facebook Insights data on ad level and Facebook ads, the ad id shows up as ad_id in the insights data and as id in the ads. Each condition get’s specified as a pointer, so nested values are also supported (see below):

Simple 2-dimensional data
Simple 2-dimensional data
Joining data where one part of the condition is nested
Joining data where one part of the condition is nested

Target

The target field allows you to set a pointer that where, given that the conditions are met, data from data list b should be joined onto data set a.

 
Notion image

Putting it together

Let’s complete the example assuming we have Facebook insights data and Facebook ads in sockets a and b, respectively.

 
Facebook Insights data in socket a
[
	{
		"spend": 25.23,
		"ad_id": "123456789"
	}
]
 
Facebook ads data in socket b
[
	{
		"name": "Ad Name 123",
		"effective_status": "ACTIVE",
		"id": "123456789"
	}
]

Using the conditions and target fields we can now join the data:

Notion image
Notion image

Result:

Joined list
[
	{
		"spend": 25.23,
		"ad_id": "123456789",
		"ad": {
		  "name": "Ad Name 123",
		  "effective_status": "ACTIVE",
		  "id": "123456789"
	  }
	}
]
 
 

 
 
 
Did this answer your question?
😞
😐
🤩

Last updated on January 31, 2023