简体   繁体   中英

best way to create settings for a google apps script deployed as web app

I want to embed a Google Apps Script in my Google Sites. So I need to develop it as a web app. I want it to have some settings (specifically, a key to a spreadsheet to use as backend). This is not something that is managed by the users of the script, rather by the one embedding the script (me, but maybe others sometime). What is the best way of doing that? Also, while developing the script there's the deployment link where it can be used directly. How can I have the setting there?

You can use the properties service to store a key, and then change that key periodically should you wish to do so (Or allow a function by which others can change the key).

To answer your second question, the deployment link is not for embedding. Do not use it to embed a gadget in your site, otherwise the tiniest change while updating your script could render the whole thing completely unusable while you update it.Instead, deploy the script as the web app and post the deployed version to your site.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM