Hey guys,
I have created a feature where my RG is not going to load every time a new database entry occurs, but rather only when I refresh the page will all the new entries be visible. ( I needed this feature for my app)
Now my question is, is there a way to refresh only one group (RG) without having to refresh the entire page?
If the RG is set on a State list, you could use a combination of a button workflow and Do every n seconds workflow (both would ideally call a Custom Workflow).
I’m using Xano as the entire database and Bubble as the frontend and had to figure this out too.
Even with custom states I was having problems due to the Get Data from external API (Xano DB). Turns out that even if you set a custom state’s value with the data on page load, bubble caches this API call unless it changes somehow and won’t call it again if you are trying to refresh the data. To get around this, add a parameter (any kind) to your API call in Bubble, called something like “refresh_timestamp” and then in your action or condition, set that field to Current Date Formatted to JSON-safe - that way the API call data is slightly modified each time it runs and will get fresh data from Xano.
To be fair this is safe so you don’t get other rate limiting errors. Here is what worked for me to update the RG when I edited an item’s data in it.
Load page with a custom state = Get Data API results with the “Current Time:formatted as JSON-safe” as the refresh_timestamp parameter
Make modification with an API Action (POST/DELETE) back to Xano
Trigger Custom Event with:
3a. You need to refresh the data source to your custom state: Get Data API call again with the ““Current Time:formatted as JSON-safe”” as the refresh_timestamp parameter. THIS IS CRITICAL as it will tell bubble not to use the previous data from step (1) that it has cached.
3b. Display List with step (3a) as the data source (under element actions)
Thats it! Now you can edit database objects and have the RG update without page refresh!
Hope this helps, took 3 days to figure it out - the caching information was the key since I was using an external DB
this is great advice. Thank you. I have a similar use-case but I am using Airtable as external database. I am using the official Bubble/Airtable plugin. However, this plugin does not give me the option to send a timestamp.