1

I have a Google form. When submitted, the responses go to a Google sheet. I currently have a python script that polls the Google sheet looking for new submissions and doing whatever it has to do when it finds a new submission. Instead of constantly polling the sheet, I would like to call my script after a trigger like onSubmit(). Since the Google apps scripts runs on Google's servers, is there anyway to do this given my script is on my local machine?

I'm looking for something like

function onSubmit(e) {
  runMyScript("/path/to/script.py")
};
Oscar F
  • 323
  • 2
  • 9
  • 21
  • I'm not really good at API request but gess you could run your google script via an API request in the on submit trigger and execute your local script in the google script. perhaps you could try that. – JSmith Sep 11 '18 at 04:38
  • https://stackoverflow.com/questions/51966939 – TheMaster Sep 11 '18 at 21:01

1 Answers1

0

If you are running a Google script from the spreadsheet then there is no way for you to call a local script on your computer. You would have to do an HTTP or HTTPS request to your script which would have to be accessible from an external network

Vytautas
  • 2,238
  • 1
  • 9
  • 20
  • 1
    This could work. How would I go about doing that? Do I need to setup a web server and put my script in there? – Oscar F Sep 11 '18 at 07:07
  • @OscarF the only way you can reach a script hosted on some local machine is to do an HTTP/HTTPS request and wait for the response. Otherwise you can use an API and simply do the entire script clientside and push information you need to Google servers. – Vytautas Sep 11 '18 at 10:13
  • How do I make my script on my local machine accessible via HTTPS? – Oscar F Sep 11 '18 at 14:40
  • @OscarF that I would not know – Vytautas Sep 13 '18 at 06:33