Updating API Cache onClick of Save Changes on a table

Hi All,

Does ReTool have a feature to update the cache (that was created using the data from a get API) on click of the default Save Changes button on a table?

I have an API query which pulls data every 15min and caches it. The data is displayed on a table. I would like to know if there are options to update the data displayed on the table on click of the save changes button. It takes a while (due to bulk updates and offline approval process) to get back the updated data from backend and display it on the table. As soon as the save changes button is hit, ReTool displays back the data from the cache, which is the old value.


Hey @mahesh.deshpande, happy to help!

I'm wondering if adding caching in the advanced settings of the API query and then adding an event handler at bottom of the query connected to the "save changes" button to trigger the API query again would work for your use case?

Here's a screenshot of the cache button in the advanced of the query panel:

Also, here are our docs on caching for your reference: https://docs.retool.com/docs/caching-in-retool

Hi @Jay,

I have implemented the caching, but the problem is it takes a while to get the updated data back from backend API, like 5-10min, as there are multiple business rules that have to applied and sometimes a manual approval is needed. While we wait for the updated data to be pulled from backend API, I was wondering if there is a way to update the cache at ReTool and have the updated values reflected on the UI, until the next scheduled API call pulls the updated data from the backend.

Ahh okay, got it! Do you think that setting local storage could work for what you are trying to achieve? https://docs.retool.com/docs/multi-page-apps#sharing-data-using-localstorage