Make one and only one toggle on?

Let’s say I have a toggle column is_primary with 3 rows.

I want there always to be 1 and only 1 toggle on, and the other 2 off.

When I switch one toggle from off to on, automatically switch off the previous “on”.

Any way to make this work?

P.S.
my current workaround is to have a check column, with formula
thisTable.[is_primary].countif(CurrentValue)
and flag it red if not equal to 1 with conditional formatting.

but I’ll have to manually switch on/off.

Thank you guys!

@Eric_Feng I recommend you provide a dummy doc with your current solution, as it makes it easier to understand what the solution might be.

:waving_hand:t2: @Eric_Feng

welcome to the community ! :hugs:

would suggest toggling off the other two via an automation. BUT this would depend how instant you need it. Automations in Coda arent that instant (sometimes up to a minute or two) so if this isnt a non-starter for you and you need more guidance how to execute - let us know :slight_smile:

cheers!
Mel

Another way would be to use a button to toggle the check boxes.

You would then have a button in each row, with a runactions() to switch thisRow on, and “the other two rows” off. Simplest might be to switch everything off first, and then switch thisRow on.

P

1 Like