I have a RG that displays data from a GET API Call.
I have a button on that page that creates a new record in the remote data source using the POST Api Call. When this action is completed, the page does not display the new record. I have tried to use “Element Action / Repeating Group / Display Data” in the workflow to send the data again to the RG but this does not work. I have solved it by using the “Navigation / Refresh the page” step in the workflow but this is slow and thinking this is not the best way to do it.
Oh I see. Here’s the issue: the GET Call only happens once, Bubble is going to cache the response to that call so even though the data changes Bubble won’t ask for it again. If you add a “header” field to the API that isn’t needed by the API, like an extra date field, or a random number, then when you display the list again via that Action and change the random number, the API response should update.
Yeah, the goal was to put a changing piece of data so that every time it was requests bubble things the api call was different. When you added the “is empty” to the end of the generator it was always false, so the value actually never changed even though the random number did.
I am just starting to play around with APIs and have things setup to test this approach and feel as if I must be doing something wrong.
When I use the approach from @david17 to have a Date parameter in the header and subsequently follow the workflow actions to display data in the RG with the header set to ‘current date/time’ the refresh of my RG works, but only once.
When I use the approach from @jici to clear the list and then to display the list again, this also works, but only once.
I then tried to use the random number in a header, and that doesn’t work at all.
In the first two approaches that work, but only once, if after I run the workflows for the second time and do a page refresh the new data appears.
Is there something that I am missing to make the RG refresh every time or is it something that actually only works once?
I tried to add a one second pause between the action to create data in the API and displaying the data in the RG using the GET call, but that didn’t help.
Through all the testing I only ever once saw the RG data get refreshed twice (ie: workflow ran twice without a page refresh) but it failed to do it a 3rd time and every other test remained with only 1 instance of the RG data getting updated.
If you can make your app in public view mode and share your editor link, maybe we can have a look and try to find why it’s not working. For me both way work correctly.
did you check also for API Limitations? (# of calls you can do each seconds for example).
The API is just set up between two of my bubble apps as I am just trying to get a grasp on how APIs work generally, so unless Bubble puts some API limitation by default, I don’t believe there would be any reason a limitation would cause it to not update unless there are settings in the app for this.
Here is a link to the editor
On preview mode would need username and password which are username and password
The create Via API button is what will trigger the creation and the updating of the RG
First the ‘Input SSN’ will need some number then press encrypt button…once it is in encrypted (second input will display it) then can press the create Via API button.
The RG above the grey container has the API Get response results and the count above it SSN API is the count of the results, which in screen shot shows 14.