Mobile checkbox or slider for simple boolean

Trying to use either a checkbox or slider with simple true false logic populated with a boolean from a query in a mobile app. This works very easily in the web version, but I am totally confused with the mobile checkbox.

I am confused by the array aspect of the mobile version for values. I would expect a simple boolean would have a {{checkbox1.value}} of 0 if unchecked and 1 if checked. That does not sem to be at all the way this works vs. the webversion of the retool checkbox works just as described. What am I missing here?

Would like to set the default from {{}} which is either 1 or 0 and then run an update query if it gets toggled. I'm pretty sure this part will be easy if I can get a simple 0 or 1 T/F boolean value from {{checkbox1.value}}.


Hey @geoffsharris!

The new switch component should support both true/false and 1/0 as potential values since it only represents a single switch.

The checkbox component, on the other hand, is built to have multiple checkboxes. Each one is given an id and then marked true based on whether or not that id is present in the component's value (an array of ids):

If you want to only have a single checkbox you can try passing in something like {{ ? ['foo'] : [] }}

Does that work?