Could anyone advise on the most elegant approach to restricting the selection to 1 item in a RG. I have a RG with a checkbox which adds a custom state. I am trying to figure out how to restrict the user from selecting another item until an exiting item is unchecked.
Hi @Bubbleboy If the User can only select one item, I would have the custom state not be a list. Instead of using the ‘plus item’ and :filtered options, the custom state value would automatically be ‘set’ to the single item which was most recently checked by the User. I tried to open your app, but I think it may be set to private - if you have any questions I can definitely help you set this up!
Hi @fayewatson Thanks I think the URL on forum posts adds AMP to the opened app URL try…“https://bubble.io/page?name=index&id=restrictrgselection&tab=tabs-1” The custom state is not a list and i could not find a way to use this to restrict the user from checking another checkbox…i thought the only way was to use a condition…ive tried disabling the checkbox and adding a delete custom state…thats awful, Im sure there must be another way
Ok cool Since you only need one checkbox checked at a time, I placed the repeating group in its own group. When a checkbox is checked, the value of the custom state is set to that cell, and the group which contains the repeating group, is reset.
The formatting for the checkbox to be unchecked by default, and the conditional formatting for the checkbox to be checked when it is equal to the custom state’s value:
When the group is reset, this formatting makes sure that the custom state value checkbox is checked, only, and the rest become unchecked. When the custom state value is not empty, the minus button to set the custom state back to empty, has this workflow:
I also changed the type of the custom state list to be the RG Thing, instead of a text in order to use “Current cell’s Thing”, instead of “Current cell’s Thing’s name”.
@fayewatson Splendid and thank you for taking the time to explain the logic and process with screen shots.
No problem at all!
This topic was automatically closed after 70 days. New replies are no longer allowed.