How do i merge two APi connector API's without keeping the data type as text

Hi,

I am facing an issue where I would like to Merge API A and API B in Bubble together. I have configured both of them in API connector.

Now if I want to merge them and chose one column each while merging I am able to do it, If I want to merge the tables as a whole and then use any of the fields between tables to display data, How do I do that?

Every time, you do a merge, you need to have the data type of a group or repeating group as text, otherwise merge will not work fine and will show errors.

Anybody else facing the same issue or any solutions to it?

Here’s how I would do it:

  1. have a repeating group. The source of that is the call from one of the APIs. Let’s call it API_1.
  2. In each row, you can have an element that makes call to API_2 based on a criteria that both APIs share (email, id, etc.).

That should allow you to merge both tables.

Does this help?

Another alternative might be to create a new data type in Bubble with all the fields of the 2 calls.

@rico.trevisan

Thanks for your reply, I am currently doing it in the way you mentioned, But the downside of this is the speed and performance. It makes a API hit for everyline once, which is not a effeicient way of using data.

Can you help me with the understand the second way a bit better?

Here’s an example. Step 1. I built a table with the source being API_1 (Subscriptions in my case - Assinatura in Portuguese :brazil: ).

For step 2, I want to make a call to API_2 to get the Status da Porta:

I add an element and for its source I use the API option.

In that API call I can use variables from the Parent Group (aka API_1).

image


About performance, I believe that Bubble will tries to optimize those calls. For instance, if on the same row, you’re making 3 calls to API_2 to populate different columns - Bubble recognizes that and does only 1 call.

But performance is too broad a term. Maybe try it out the simple away. If that’s too slow, I would consider having all the data on the Bubble database directly. Which would likely mean that you have to pull all the data you need, create a syncing mechanism, etc… A bit more work, but it might be worth it.

Yes, Completely agree on the point that if in a line we are making multiple hits to same api bubble considers it as one hit. But the issue here is that bubble will have to make one hit every line and that takes some extra time to load.

As far as the second way of doing it is concerned, I believe syncying with Bubble is that create these two api tables in bubble and then merge together? Else Create a new table in Bubble which has all these columns and then use them as data type to get this information?

The latter: create one Bubble table and save to it both API_1 and API_2.

@rico.trevisan: Thank you for taking out time in helping me. Just one last thing to check.

I tried to create a table which contains the rows of both the tables and tried to use the merge condition in the repeating group, still it is not working fine. Adding screenshots of the same.

Can you Guide me on where i am going wrong here?

What I meant is that you have to

  1. first save all the data “locally” (aka to Bubble), for example e.g.: using a backend workflow.
  2. then, the Data source for your Merged Data Repeating Group will be something like Search for Merged Data.



Let me try to understand your app. I see Creatives, Campaigns, and Test Results. Let me guess: * a creative (user) can have multiple campaigns * each campaign can have 1 or many test results

The data you’re trying to merge is the Campaign with the Test Results. Correct?

@rico.trevisan

Thanks for making it clear, Yes, You are right about the app, I am trying to get the campaign with its creatives.

This topic was automatically closed after 70 days. New replies are no longer allowed.