PropertiesService.getUserProperties(): id is always in memory, I can't delete it

26 views
Skip to first unread message

Stefano

unread,
Jun 11, 2020, 4:43:21 PM6/11/20
to Google Apps Script Community
Dear, I don't understand because I have this problem....

function InterfacciaCalendario(){
 
var id = PropertiesService.getUserProperties().getProperty('FILEID')
Logger.log(id)
if (id === null)
{
creadatabase
()
notificationCallback
()
}
}


When I execute it....id is always in memory.
I delete it from here:


But when I execute it, ID is always the same and always in memory then id is not null and creadatabase() and notificationCallBack not run.
How could I do?

Alan Wells

unread,
Jun 11, 2020, 6:03:35 PM6/11/20
to Google Apps Script Community
The user interface that you are using in the Project Properties dialog box is for Script Properties.  You are not setting Script Properties.
You are setting a different type of property.  User properties can not be accessed through the Project Properties dialog box.

  • Script
  • User
  • Document
Those 3 types of properties in Properties service are different.

Stefano

unread,
Jun 12, 2020, 12:02:17 PM6/12/20
to Google Apps Script Community
ok, I thought that I could manage it by that windows, I hadn't notice the particularity, so I could delete it just by code? Nothing user interface? :(
It's not a problem...but user interface to manage some aspects is useful.

Alan Wells

unread,
Jun 12, 2020, 12:50:15 PM6/12/20
to Google Apps Script Community
If, for example, your code had settings that you didn't want the user to be able to see, edit or delete, then you wouldn't want them to be able to access those settings through a user interface.  That's part of the reason for why it's set up the way it is.
Only the script owner can access the Script properties user interface, and that's good.
Imagine that you wanted to give a user free access to a paid add-on, and you don't want to add them to the customer list.
You could have your code check script properties every time you want to check if the user is allowed to run the code,
and if their account email was added by you in script properties, then the code could make a setting in their user properties.
So, you can affect User properties through Script properties, in a two step process like that.

Stefano

unread,
Jun 13, 2020, 4:41:07 AM6/13/20
to Google Apps Script Community
ok, I understand it, thanks!

I've solved it coding a function and then from Google IDE I call that function to run.
Reply all
Reply to author
Forward
0 new messages