This is my code
function myFunction() {
var userProperties = PropertiesService.getUserProperties();
var property = userProperties.getProperty('property');
if(property === null){
Logger.log('null')
userProperties.setProperty('property', '2');
}
Logger.log('property: ' + property);
userProperties.deleteAllProperties()
}
I created a log in it twice
First time to identify whether property is null and if it is null insert the number 2 into it
A second time is to see if the number 2 exists in property
The problem is that on the first run I get the first log null and the second log property: null and on the second run I get property: 2.
Can't this be updated in the same run?
I apologize for my broken English and thank you for the help