I have a Google Apps Script bound to a Google Sheet, and have published that as a Web App. It is restricted to a certain Google Workspace. That Google Sheet is kind of an improvised database for that web app and changes over time. I would like to send the updated data to all clients once the Google sheet gets changed. Is that possible? I don't need a trigger for the edit, since I know in the script when I add new data, so this is the time to send the new data.
Basically the same question can be formulated as follows: We know that we can execute a server-side function from the client with google.script.run
, but is it also possible to execute a client-side function from the server i.e. the apps script?
My current workaround is a client-side setInterval
which checks for server-side updates (and fetches them using successHandler) every 30 seconds or so. It works, but is not optimal.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…