Check box outside repeating group check all the checkbox in repeating group

i have a checkbox on top of a repeating group. how do i make the checkbox on top check all the checkbox in the repeating group. tried using custom state method but cant manage to get it right. heres the screen shot of my apps

and also, by uncheck the top checkbox will unselect all the checkbox in the repeating group

is there way i could do it without any plugin?

Yes you can do it with states but it will be slower.

do u happen to know how?

Good Morning;

Your RG must be in a group (call this group “Resetable Group”)
Set the status of the Checkbox in the RG to “Dynamic”.

Define a custom state in your RG
Ex: State name = Selected
Type: User (and make sure this is a list)

If you organize your workflows as follows, you get the result you want.

Check Box which in the RG
This checkbox is checked >Set State Element: RG
Custom State: Selected
Value = RG selected User:plus item Current Cell’s User

and

This checkbox isn’t checked> Set State RG Selected
Value = RG selected User: filtered

List Filter
uniqueid <> Current Cell’s User uniqueid

To select or deselect all

Select all checkbox is checked (outside the RG)

Set State> RG Selected
Value: RG’s List of users

Select all checkbox isn’t checked
Reset data “Resetable Group”
Set State “RG Selected”
Value: “empty”

I almost forgot.
Dynamic status for checkbox (in the RG)
RG Selected user contains Current Cells User (this produces a yes / no)

Good days!

1 Like

Ambarlamedya you are correct! I forgot you can make list states.
I have simplified your suggestion

image


I’m not at the computer, but I’m sure you did. Thanks. This will make it easier to understand.

Doesn’t it make it a bit harder to simplify? Will you change the number in the workflow and condition each time the data changes? @danielowega


my number of data in repeating group is dynamic because of filters. how is that?

i cant really imagine this without an example.

this is what i did if manually selecting a user in the repeating group to add it in a temp list of the custom state

and this is to remove when the check box is uncheck @fayewatson

this works but im stuck at the select all button out side the repeating group. i want to make all the checkbox in checked . when i check the checkbox outside the group also, add all of the data in the repeating group in the temp list of a custom state.

If the number of checkboxes is dynamic you can replace 4 with do a search
for x:count. I made the example like that because it will work faster without searching.

Acap this has been solved for you. Copy the example, it’s not hard.

ok done. it works. thank you!!!

I think you answered here. You even gave me my next question.

The method you propose is not entirely wrong, it will work. It’s definitely not entirely true either.

Aren’t we gonna consider performance? Does it make sense to query the database every time a checkbox is checked?

If you can say no performance matters, you can use the above solution.

Proper use should be as follows.

Live : https://takeaname.bubbleapps.io/version-test/select_all?debug_mode=true
Editor : https://bubble.io/page?type=page&name=select_all&id=takeaname&tab=tabs-1

Good luck

Our methods are the same I only say simplified because contain/ doesnt contain is more human readable. & except for count is 4/not 4. I made that demo expecting the checkbox count not to be dynamic. So really it is perfect for that.

Of course to make search for data count is slower than looking at the repeating group state count.

Your example is not humanly readable


I improved my example to allow for dynamic amount of checkboxes
image
image

1 Like

i do need to put the checked db in temp list to delete it. this is what i did overall

(checkbox a is in the repeating group for each db, check box b is select all which is outside the repeating group

would this affect the performance? its working for now

Great stuff!!
This really helped me solve things in my current project in a way that’s both good for the user experience and performance-wise.

Thank you @eren!

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.