Issue with Google Sheets and Check Boxes

Hi,

So I'm using google sheets as a resource. I have a boleean column that I use it with a check box in forms and tables (I use table edit too).

When using the form to add a new row, retool creates that cell with a TRUE of FALSE deppending on the checkbox status. It works as intended.

The problem is when the table shows this column. It shows the check box checked whenever there is a TRUE or FALSE in the row, it only shows it unchecked when the cell is empty, so the checkbox status in the table is ON when there is something in the cell (either TRUE or FALSE) or OFF if the cell is empty, but when I uncheck the box and save, it changes the cell from TRUE to FALSE as it should but keeps the box checked. Does it make sense? I am doing anythin wrong?

Thanks.

How is the field stored in Google Sheets? I'm not too familiar, but I assume it is a text field, which can be a little finicky when you want to treat it as a Boolean. Instead of storing a boolean false you may be storing "False" (a string with a capital letter) which is actually evaluated as boolean true.

As you can see below, you should be able to store a string "false" (no capital letter) and have it evaluate as expected (i.e. false, and therefore no checkmark):
image

Hope that helps.

Yep. It seems it is the problem. google sheets stores it FALSE or TRUE, not in small caps. but that is what retool sends to google sheets. Now I need to investigate why it is this way or how can I solve it.

thanks!

Glad it helped. In the form you are using to add a new row, check the value of the field (not the label) which is what gets sent. Might be as simple as using false for the value of the selection and False or FALSE (or whatever) as the label.

If you can't change the way the data gets sent to the source, you could add a transformer to lowercase the data when it comes back to Retool using something like ... _.lowerCase(['Google Sheets Field Name']) ..., though I would try to fix how the update gets sent to the source rather than mask it like this.

Thanks a lot for the help, but for now I'm not going to spend more time in this, I've just changed it to TAG option with only one possible option instead of the checkbox and works fantastic and it is only one more click. When I have time i'll check it again. I really appreciate the help!