How to select multiple entries from a Repeating Group

I have an RG with Driver ID numbers (left column). User needs to select 1 or more drivers, using the Checkbox input, then press the Select driver button to proceed:
41

How do I create a list of the selected drivers?

I can start a basic workflow like this:
08
but can’t work out how to code (sorry!) the requirement that the checkbox is “yes”.

Check out this example. You can use a custom state to hold the selected items for reuse.

2 Likes

Hi Daniel,
Thanks, I think I understand the flow.

However I came unstuck when trying to set up the Set state part. I can’t see uniqueid<> in the List filter constraints dropdown.
Here’s what I see:

Can you help please?

1 Like

the custom state needs to be of type “Driver Thing”, and make sure you check “…is a list”.
46.

You can add the custom state to any element on the page, even the page itself.

Then you need to add an event tied to the checkbox element in the RG cell “when input checkbox is yes…” set the driversList state to driversList plus item:[driver in current RG cell]. That will add the selected driver to the driversList state. You can use driversList <>uniqueID to remove a driver from the list.

I suspect you’re not seeing the unique ID option b/c you haven’t made the State a list, but could be wrong.

Hi,
I went back over the structure and found that my RG inner cells weren’t actually “below” the RG.
I’ve made the custom state (selectedGW) a list of numbers, added to the nearest page.

But I still can’t get the List Filter to show unique id.

Would you be OK to have a look at my editor here: tickets-gw | Bubble Editor

Many thanks

Curious - I have got the workflow working for the case where the driver is NOT in the selectedGW list, but I still have the old problem (unique id not in the filter dropdown) for the case where the driver IS in the list.
Strange!

@rob1 I just posted a video walk-through showing how to do this exact feature if it helps (or if anyone else is interested): https://youtu.be/yahP3RyVggY

2 Likes

Great video!

I like the add to list but I agree, it would be so much more helpful to have a subtract item from the list instead of having to filter the one items.

So in essence what you are doing is:

The custom state is a list of users. And then upon check or uncheck do this:

  • Current list = Current list plus the item just checked, if it was checked
  • Current list = Current list but we filter-out the just un-checked item (we find this item by asking for it’s unique ID)
1 Like

My problem (couldn’t get unique id to appear in the :filtered box) is solved!
The problem was that my state (selectedGW) was a list of numbers. I changed this to a list of Drivers and that fixed it.
Seems obvious now that a number can’t have a unique id :slight_smile:

But please consider this another vote for having a :minus operator.

Great video Gaby and great support from Daniel too.

1 Like

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