Check box: Values depending on checked/not checked

Dear Glide Community,

I have an app in which I use a form with check boxes. I would like to be able to set different values ​​in the spreadsheet instead of just putting true or false.

For example:

If the box is checked = “Correction required”
If the box is not checked = “leave the cell empty”

Is there any way?

Thanks in advance for your help

Have you tried the If Then Else column in the data editor? There’s a video that explains it on your app dashboard.

Hey Pedro,

The IF Then Else column in the data editor works great for that purpose.
Otherwise if it’s not a fit, what I did for an app was having a column in the Google sheet with an IF() function where the logical expression refers to the checkbox column being TRUE or FALSE.
Hope that helps!

1 Like

Hi Karim,

Thanks for your answer.

I agree with you, but unfortunately by unchecked box there is no value in the spreadsheet cell.

So I can’t use the if then else function as only checked boxes return TRUE and unchecked boxes don’t return any values.

I don’t know if there is an syncro issue (by unchecked boxes) or if this is a normally working

Thanks again and best regards

@Pedro_Gomes Check this app https://zkxhb.glideapp.io

It is a sample of what you asked for. The spreadsheet only has one sheet and one column. I set it so you can copy it and take a look. I created an IF-ELSE Glide field as David said to accomplish what you wanted. You can add rows and set the flag (logical true false) and based on that you can see those two text strings.

2 Likes

Hi Pedro,

I struggled with checkboxes aswell in the beginning. The syntax of the IF() function is different.
Let’s imagine you have a checkbox in glide that returns a checked or unchecked box in cell A1 of your sheet and you want to return the text “Check on” or “Check off” depending on if the checkbox is TRUE or FALSE.
In this case the function is as follows:

=IF(A1 , “Check in” , “Check off”)

The logical expression is just about referencing the cell where the checkbox is.

Hope this helps

Just remember, in an IF statement:
“is not TRUE” gives you the same result as “is FALSE”

@George_B demonstrates well using the ELSE, which covers any value that is not TRUE, such as “blank”, “false”, “bob”.
In @Karim example using the formula inside the sheet instead, A1 is checked for TRUE and the next argument (check in) in the statement displays if the result is true. If it is not true, then the third argument (check off) is displayed.