Search code examples
google-apps-scriptgoogle-appsgoogle-sheets-apigoogle-docs-api

Google apps domain wide apps script properties using GAS


I need a domain global variable that will be set by the apps administrator of a domain and all the users apps script will read the variable and apply the settings inside their apps script.

The script is deployed as a web app. However, script property or document property cannot be used since the apps script is can be deployed across many domains. aka for a domain it should be unique property.

For example, I am an apps admin of 'mydomain.edu', I set as

scriptProperties.setProperty('EXAMPLE_PROP', 'mydomain.edu_property');

Some other apps admin of 'somedomain.edu' sets

scriptProperties.setProperty('EXAMPLE_PROP', 'somedomain.edu_property');

Then, the setting will be in conflict. I need each domain to have unique value set to the property EXAMPLE_PROP for the same apps script.


Solution

  • The answer was store everything in a file. The administrator can share a readonly version of the file with all users in a given domain. I have a bunch of utilities I wrote for storing simple arrays and dictionaries in text files here.

    Note: This may not be an acceptable answer see notes below. And this link