Automatically Refresh Snowflake Query and Update GSheet

Hi All!

I have setup a ReTool app that queries from snowflake and then sends the queried data into a specific tab in a Google Sheet. I've set up a "Reload Data" button and a "Send to GSheet" button.

As you can guess, the "Reload Data" button runs the snowflake query and the "Send to GSheet" button sends that data and "updates" a set of cells in a google sheet within a specific tab.

This all works as intended when I run things manually (by pressing each button sequentially). However, I want the app to refresh and send to GSheets automatically every 2 hours. After some research, I found that if I set the run to "Run query automatically when inputs change," I can go to the "Advanced" tab and check the "Run this query periodically" box and set a refresh time in ms. I set the time to 7,200,000, which is every 2 hours in milliseconds. I then set the downstream "send to GSheet" action to update the data to gsheet automatically when the inputs change as well.

The problem is that the query does not seem to be refreshing on its own every 2 hours. Do I have to keep retool open at all times for this to work? Is there something I'm missing?

I'd appreciate any help with this...I've looked around in this forum, but haven't been able to find a solution to my specific issue.

Hey @ysp!

Great question! At the moment, the closest thing to a cron job in Retool would be your current setup. With this setup, you will need to keep the Retool tab selected for this query to run since most modern browsers prevent queries from running in non-focused tabs. We are hoping to ship a solution to this use case although I'm not certain on a specific timeline. In the meantime, do you think keeping this tab open would work for your use case?

Thanks @Chris-Thompson! This makes sense and it's good to know you're working on a solution. Keeping the tab open doesn't work for my use case, but letting key stakeholders know that they can manually refresh by clicking both buttons should be fine for now. Thank you again.