Automated extract to Google Sheets?
We have work that lives in Google Sheets, but the source of truth is in our PostgreSQL database, which we update often. When we update our SoT, the Sheets data becomes out of date until we manually update it.
Is there a way to create a feed of sorts where a Mode query can update a Google Sheets workbook?
Hi Austin King
We currently do not have a way to automatically export data to Google Sheets. This is a popular feature request, so we definitely consider it. Happy to add your vote to this request.
In the meantime, another option is you could do this programmatically by following the instructions here: https://gist.github.com/bstancil/442c885c4e73eb5012ab016ee3d5f7ca
However, this function works well if you import data manually. You would need to run the formula every time you need to import results. Hope that helps in the meantime.
Following up here in case anyone else is interested in trying this. It generally works well, but there are some rules to be aware of if your table contains strings because of the regex in the script (which I don't know how to fix).
- No spaces at the beginning or end of the string
- no commas (semicolons are ok)
- No double quotes (") or single quotes (')
- No line breaks
- No ~
Also, you can configure the script to run automatically (use a trigger on the Google Script) and you can set your Mode query to also run automatically. I set both the script and the query to run hourly.