Forum Academy Marketplace Showcase Pricing Features

How to combine 2 API results into a repeating group

Hi guys,

So I have 2 API calls. 1 from Facebook and another from a Internal Reporting system of a company. Both results have can be joined with a primary ID (primary key). However, how can I join both results in the repeating group when we are only allowed to select 1 object in RGs dropdown.

Thanks in advance! :slight_smile:

1 Like

A custom built plugin :wink:

1 Like

One idea: Make the RG search somehow spit out that primary key. You could even set the type to text. In the row (aka item inside of an RG), you can have 2 groups, each group has a different type, each’s source with a do a search… where you can use its parent text (aka your primary key).

1 Like

This is something that could be a solution, however, it is not an optimized solution…what will end up occurring with a list of results of lets say 100 items inside the repeating group, meaning there will be two searches happening for each result…this would be 200 searches taking place at the same time.

Definitely a good approach in terms of taking the results of the two separate API calls and extracting the primary key as a text field and sending those into a single RG that will be of type text and just display the primary key value alone.

I would say to expand on the concept and reduce the searching, would be to use either a custom state as a list or a list shifter element to hold the results of the two calls as separate lists and in the single rg that is using the primary key as a text field, for the elements to display values associated with the calls, I’d put the custom state list with a filter operator to filter the results…this too of course would result in a bit of a delay for the filtering to take place, and relies on the users device power for it, but could be faster than searching possibly.

What exactly is the use case here? Why do you want to display the results together in a single RG…what is the user going to do with those results (just display or would they operate on the associated data)?

1 Like

hahahah. Time to bring out the Javascript skills in me :laughing:

Thanks for taking the time reading this, really appreciate it! Let me try these things out and see where I end up with.

So the use case here is comparison of data
Facebook Marketing API shows sales in their dashboard while the internal system (Gold Lantern) also has a record of sales based on its tracking.

We want to compare the difference of both systems to know where sales are really coming from.

Our primary key is the Facebooks Ad id which both systems have identical.

Why not just set up two separate repeating groups…one for each separate set of sales data (Facebook vs Gold Lantern) and then have a searchbox or input element that you type in the primary key and then filter the two separate sets of data in their respective repeating groups to show the details for each one side by side to compare them?

Likely you already have the primary keys stored somewhere, and could easily add to this a third repeating group displaying only the primary keys, from which you can select on from that list and it will automatically filter the results of the sales repeating groups to show only that particular set to compare them side by side.