dimanche 16 avril 2023

gSheets checkbox value sometimes 'true' or true - what gives?

I have inserted multiple checkboxes in a Google sheet. I then use code to read the value and do things if it is true.

The line in question reads if (variable == true){ then blah blah but sometimes I have to have if (variable == 'true'){ with single quotes for the IF statement to read as TRUE and go do the thing.

There doesn't seem to be a rhyme or reason as to which I have to have. I just have to play with it. I'd really like all my checkboxes (will be 52) to be the same and consistent but currently, that's not the case. I inserted and then did a copy/paste of the boxes but since went back and did insert for all. No change. Has anyone seen this and any suggestions? I don't care if it is with or without the quotes, would just like it consistent.




Aucun commentaire:

Enregistrer un commentaire