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.
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:
- Create a state on the page. The state’s data type should be the same data type as your repeating group(s).
- On Page Load, set that newly created state with the same data source (API Call) as your repeating group(s).
- Now in your repeating groups, replace the current data source with your newly created state.
That’s got it. Thank you very much