I am checking that a user makes a selection from a listbox. It appears that if no selection is made, the value passed to the server handler is “null” NOT null. Is this working as intended?
This code correctly tests for no selection in selectList listBox.
Logger.log("e.parameter.selectList"+e.parameter.selectList)
if (e.parameter.selectList === "null") {
error = true;
errortext = "no valid region selected";
Logger.log('error')
}
I expected
if (!e.parameter.selectList )... to work
Yes, this is known.
All the values in the handler are returned as string (except the dateBox value, I am not sure though). E.g checkbox value is returned “true”/”false” not true/false (a boolean value). You will have to parse these strings first to get the values in the desired form.
I usually use
Utilities.jsonParse(stringValue)