0

I have a python script (on my local machine) that queries Postgres database and updates a Google sheet via sheets API. I want the python script to run on opening the sheet. I am aware of Google Apps Script, but not quite sure how can I use it, to achieve what I want.

Thanks

2 Answers 2

3

Google Apps Script runs on the server side, so it can't be used to run a local script.

Sign up to request clarification or add additional context in comments.

Comments

2

you will need several changes. first you need to move the script to the cloud (see google compute engine) and be able to access your databases from there.

then, from apps script look at the onOpen trigger. from there you can urlFetchApp to your python server to start the work.

you could also add a custom "refresh" menu to the sheet to call your server which is nicer than having to reload the sheet.

note that onOpen runs server side on google thus its impossible for it to access your local machine files.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.