Single API call with two repeating groups

Hello Team,

I have two repeating groups that display data using the same API call but with different parameters (only one parameter).

In order to reduce the number of API calls I would like to make a single call with no parameters, which would return all of the results unfiltered, then assign them to their respective repeating groups based on the API parameter.

This would halve the number of API calls required.

Doable?

Cheers

Kurt

Yeah, you’re kind of explaining your own solution.

The reason you’re creating 2 API calls is because your 2 repeating group’s data sources are independent of one another.

Let’s change that!

One solution would be:

  1. Create a state on the page. The state’s data type should be the same data type as your repeating group(s).
  2. On Page Load, set that newly created state with the same data source (API Call) as your repeating group(s).
  3. Now in your repeating groups, replace the current data source with your newly created state.
1 Like

That’s got it. Thank you very much :slight_smile:

1 Like