There should be a way to push / pull ScriptProperties from the Script.
There is no obvious way to do this besides opening it in the browser editor and doing File > Project Properties
node -v): v10.15.0clasp -v): 2.0.1I think you mean Properties via PropertiesService.
https://developers.google.com/apps-script/reference/properties/script-properties
Maybe you can use clasp run to use that method. There's no API to access these properties. I'm not sure your use-case, but perhaps you could just use a Sheet to access properties instead.
As Grant mentioned, it isn't feasible to build this given the limitations of the Apps Script API that clasp uses. You could add a helper function to your script like:
function setProperties(properties) {
PropertiesService.getScriptProperties.setProperties(properties, false);
}
And then call clasp run from your environment, passing in the properties to set:
clasp run 'setProperties' '[{"foo": "bar"}]'
I don't think it makes sense to build this into clasp however, so closing this issue as not feasible.
that should be sufficient. Thanks!
Looks like clasp run can't be used with scripts that are attached to google forms, as running them gives me
Script API executable not published/deployed.
And trying to click "Publish as executable API" give me an error popup of "Can not retrieve script execution endpoint information" (I am translating from Japanese, no clue how to switch back to English)
oh well...
And then call
clasp runfrom your environment, passing in the properties to set:clasp run 'setProperties' '[{"foo": "bar"}]'
This is brilliant!
@junderw - There should be no problem publishing a form-bound script as an executable, and I just tested it myself. Maybe it was a transient error? Perhaps check to make sure there is nothing strange in your manifest?
Do you have a document on how to do this?
Manifest file? (This is my GAS deployment knowledge level)
This is the documentation on how to setup the execution API:
https://developers.google.com/apps-script/api/how-tos/execute
I'm not sure what problem you are running into, so hard to advise, other than say hack around and try different things.
Most helpful comment
As Grant mentioned, it isn't feasible to build this given the limitations of the Apps Script API that clasp uses. You could add a helper function to your script like:
And then call
clasp runfrom your environment, passing in the properties to set:I don't think it makes sense to build this into clasp however, so closing this issue as not feasible.