I’m struggling with setting correctly a Date field. Basically I have a field with Date type which I set to Date.now() when something happens. If anything else happens I want to blank out the field and leave it emtpy. If I try…
myDate = null;
I get an error reading “Type ‘null’ is not assignable to type ‘number’”, and it seems the only way I can get rid of the error is by using…
myDate = 0;
Now, when I run the script and my “else” is executed I can’t seem to assign 0 to the field, and I’m getting an error reading “j: Can’t set cell values: invalid cell value for field ‘myDate’.
Cell value has invalid format: .0 must be a string, .1 must be a string, .2 must be an object”
So, the question: how can I manually assign null/empty to a Date field so that no value is displayed?
Thanks in advance for your help.
Solved! Go to Solution.