Is it possible to test a Google Apps Script that uses DocumentProperties? The testing documentation seems to indicate this is possible:
If your add-on uses the Properties service, properties will persist and remain available the next time the test configuration is run.
However, when I attempt to use DocumentProperties, I get the following error:
Google Apps Script: You do not have permission to call getDocumentProperties
This is the code I am trying:
function appFolderExists(){
PropertiesService.getDocumentProperties().getProperties();
return true;
}
function onOpen() {
FormApp.getUi().createMenu('My Addon')
.addItem('My Addon', 'showSidebar')
.addToUi();
if(!appFolderExists()){
createAppFolder();
}
}
My addon is currently deployed as a test (for a form). It is installed but not enabled.
I want to add more logic to appFolderExists
down the line, but I keep getting stuck since I can't seen to access the DocumentProperties. Am I doing something wrong or is this just an inconvenient limitation of testing addons?