API HELP? How do I make my API calls run in parallel rather than sequentially?

I have the below workflow:


However, the APIs load on the page sequentially because bubble runs each action after the prior has finished, which causes this:

I need all 4 to run at the same time so that the entire page loads in 1 second rather than 4 seconds.

Is there a way to do this?

Hi @EliteDataEngineer :wave:

I will give a shot in the dark here


If your workflow actions don’t depend from each other, then create 4 workflows events for “When popup is opened” instead of only one. It may be that this activates them all at once.

1 Like

Didn’t work. Still lined up like a row of ducks :duck: :duck: :duck: :duck:

@rpetribu @Jici

Don’t have any other idea :sweat_smile:
Maybe @Jici could give a try.

Just asking
 but why you need to wait for your popup to open to load the list in the repeating groups? :thinking: Can’t you load them before? This may speed up the process


@rpetribu Because the data on the popup is dependent on the RG row the user selects (each row is a business name and each popup is the detailed business profile)

Your list on RG should probably be based on the Parent Popup data. You shouldn’t need to use display list in RG because the Data source should be based on the popup data. When this is updated, Bubble will also update the result of the RG. I don’t know it will fix the sequentials run, but it may faster the whole process.

@Jici Display lists are necessary for popups that use API data.

This is because bubble only calls APIs on popups just once in total, meaning that if you close the popup of business #1, its data will show for business #2.

This is a known caching issue whose only current workaround is the use of display list.

@EliteDataEngineer This apply to all API Call (not just in Popup) only if there’s no modification in your API Call. If you change your popup and the RG call is base on the Current popup data, this mean that the call should be different and Bubble will request it again.
So what do you push to your popup as display data is involved I guess in your API Call and because of that, The RG will update itself from the popup data source update (only if this is used in your API Call
)

1 Like

I’ve made a test and can confirm that in this case, the RG will load parallel and not sequential. (Made a test where I have a first API Call that is used into 2 different RG group call and theses two load parallel after the first one is done)

1 Like

@Jici Your suggestion pointed me in the right direction by making me revisit ‘Data Source’ as an option instead of ‘Display Lists’.

Screenshot 2023-07-12 at 23.45.56

My API requires the current datetime as a parameter, which bubble wasn’t refreshing on the popups. I therefore ended up setting the datetime as a custom state which allowed me to go back to using data source, which now gets the calls being made in parallels!

Thanks

1 Like