Reputation: 813
I have a node script that formats a google sheets document using the google drive api and google-spreadsheet npm package. It retrieves data from one sheet in the document and then formats it into a nice dashboard.
However the data it retrieves from that particular sheet is dynamic and will change over time and it would be quite inconvenient to my other partners if I have to be at my pc to run the script for them whenever they populate more data into the sheet.
Considering cloud functions are triggered by a HTTP request, I assume I'd some how have to run an anonymous app that captures the state of a google sheet, then calls the HTTP. However I'm not sure what kind of app I'd have to create that could track a google sheets in real time?
Is this possible and if so what would be the correct method to go about such a task?
Cheers.
Upvotes: 2
Views: 724
Reputation: 83093
I'd like to find a way to run a Firebase Cloud function that is triggered by the state change of a google sheets document.
You could use an AppScript simple trigger like onEdit()
to call an HTTP Cloud Function by using the UrlFetchApp Class.
More details on HTTP Cloud Functions here.
Note that you could use the same approach to directly read/write from/to Firestore by calling the Firestore REST API.
Upvotes: 3