Validate/Restrict Switch Selection

I have a Helper Table serving several Lookups

Table-switch

and was just wondering if it is possible to restrict Selection to only one Switch

Switch

on the Form (and other) Screens.

So that one must check one Switch but can not select more then one Switch.

I think a choice component with radio buttons would be a much better option. Otherwise, you will have to create a bunch on visibility conditions to hide all of the other switches when one is chosen.

@Jeff_Hager

Sure, but that only would write to one Field whilst here I have choice of several fields, of which one has to be selected.

Also, to populate the Choice Component I would have to create another Table since it can not be populated manually.

Unless I am missing something :).

Based on what you are showing in your screenshots, it seems you already have a table to use as the basis of the choice component, so you shouldn’t need to create another one, but if you did, it would only be 7 rows.

Is it necessary to have separate columns for each switch value? If you are only allowing one to be checked at any one time, then it seems better to look at a written choice value instead of 7 separate Boolean columns. It would also be a little more efficient and scalable to use a choice component in case you ever add or change choices. You could then modify you logic to look at the written value instead of looking at separate Boolean columns.

Thanks again, thing is that those Checkboxes (Values) play a vital role in another part of the app, but it seems that I will have to rethink that part to be, as you pointed out, be more efficient and scalable!

I’m not saying that it can’t be worked out with the checkboxes, but you can’t disable a checkbox while keeping it visible, so the only option left is to hide 6 of them when one is chosen. In the end it might be more work than it’s worth. If you use a choice with radio buttons, then it still has the same look and feel, and it’s easy to pick an option while still being able to charge your mind and choose a different option without having to deselect the first choice.

Maybe if you explained the flow after a box is checked, then it would make more sense to me why you are doing it the way you are right now.

1 Like

A tricky way to do that, is creating user-specific columns - instead of normal ones - and add a custom collection of this table with all switches, but now with all rows

1 Like

Consider a list with each item showing a graphic that represents the checkbox. Each item would have an action that manages the value of the checkbox. In addition, you can build logic into the action that has complex if then else criteria.