I have a script that fetches events from my shared calendar and displays the events details in my shared spreadsheet. However, when other people try run the script, the script is unable to find the calendar because it is looking for the calendar against the user who triggers the script.
Solution: Make a Web-App and then let the user trigger a small script that runs the main script i.e. the Web-App (as suggested by Michael Aaron Safyan).
Current Problem:
I've made the web-app, and using this method, my Web-App is successfully invoked when I open URL?wake=up
in a browser.. seems all is good there.
However, The 2nd part (trigger script) does not seem to get the Web-App to run. Its using UrlFetchApp.fetch("URL?wake=up");
yet it fails to run the Web-App.
Need guidance:
How to trigger the Web-App from a function.
Yes. Scripts can be run in various different modes. This is documented at Google Apps Script: Permissions and types of Scripts. If you publish the application as a web app or as a trigger, then you can have the script execute under the account of the creator instead of the accessing user's account. For this specific case, it sounds like you want to use a trigger that runs onOpen
.