For me, it finally turned out that I just have to re-display the list in a workflow, with or withoud a date header in the source API apparently.
I was pretty sure I havetested this before but apprently not…
Hey @sam, did you get an answer?
I’m currently developing an app that heavily relies on the SQL Connector plugin and encountered the same problem then you. I found my answer on the forum; it’s quite simple.
In the SQL query you want to be able to refresh, simply add an extra parameter (that won’t be part of the SQL statement). I named mine “dummy” and the type is number.
Now, whenever you need to reference this query, in addition to your necessary parameters, you include the dummy one with the value
Current date/time:extract UNIX. As mentioned above, this will make Bubble repeat the query instead of just sending you back the cached result.
Thank you so much for your response.
Yes, I got it worked.
After couple of hard working days later I realized that time is the only parameter we have which keeps changes.
Anyways again thank you so much for the response you gave. If we have people around us like this to give helping hand, We can keep going with bubble.
Is this still working because I can’t seam to make my api calls refresh
The SQL method with a dummy parameter based on a random value like todays date in ISO format worked a charm for me today. Thank you so much.
Yea, it still works. Make sure the format of the date is correct and that it’s in the header. Here’s what the call looks like on my end. Hope this helps.
Just see your screenshot and I’m wondering what’s your fomule/pattern to get the date as an API compatible ISO ?
I’m currently using a paid plug-in just to do this conversion!
Moreover, are you able to do this the other way around? I mean getting a date from this ISO format to Bubble date? Because I’m currently unable to save data from API call as date!
Thank you, this will help me a lot!
Have a good evening
Luckily it’s a built in Bubble format - Here are the steps:
As far as doing it the other way around, I assume you would make choose “Date” when you go to set up the API Return Values - For me, “date” pulls in the right date format to work with Bubble. See screenshot.
Hope this helps.
Great tip, this just saved me a lot of work with custom states.
w.fly thanks very much ! You save me a ton of work !
@w.fly Thank you so much for the updated header trick! It’s perfect and has saved me further headache.
An update to this very old post – This method has been working faithfully for me for years, however I have noticed that every now and then it “doesn’t work”.
Turns out, it’s due to the way the “Current date/time” function natively works in Bubble. When you load a page, it gives the current date and time… however, if you keep the page open for 5 minutes, the current date/time is still what it was when you loaded the page initially.
This can lead to an issue where this worked… then suddenly “doesn’t work” (“hmm, the data is still stale… what gives!?”).
So, the new, free, 5 minute solution, that has proven rock solid for me is the following:
- Download the “Current date/time” plugin
- Place the plugin anywhere on the page you’re working on.
- Reference the new plugin vs. the native “current date/time” in Bubble.
OLD *using Bubbles native “current date/time”:
This ensures that no matter how long a page has been opened, every time you fire off another API call, the “current date/time” is absolutely the current date/time, thus ensuring fresh data with every call.
Quick question @w.fly
Is it also possible to add this “(header) date” to an API call from a paid plugin? I am using the Stripe Marketplace Plugin and also having the issue with the data that is not refreshing.
Thanks for the help.
If it’s not in the Bubble API Connector, then I don’t believe so See image for where I placed mine.
If you don’t have access to that, I am unsure what you could do… Bubble does caching automatically for you and I really haven’t found a way other than the one above to forcefully break the cache.
You’re God All works super-fast and stabile.
Thanks, you probably saved me days of research!
I’m wondering why you can’t just use “Calculate formula > Random string” instead of date?
In my case, the API I was using (Wrike) accepted Date as a header – I don’t believe I could’ve just sent it some random string.
Is this not in the docs? This was the exact problem I was experiencing. I was creating a poor-mans polling utility with a repeat every x with a conditional check. I’d really suggest getting this into the docs if it’s not, I didn’t find it at least. Thanks for the find!
I believe you can
@w.fly God Bless you mate! I’ve spent 3 days figuring out how to update the repeating group with info from API and finally found your thread. I wish I’ve found it earlier!