Forum Academy Marketplace Showcase Pricing Features

Multiselect with checkboxes in a repeating group

Hi,
We have a “Label” type of object (a Label has a name field and an image field) and a “Pro” type of object that has a “Labels” field which is a list of Label objects.

In the form pros use to create an account, we want to allow them to select a list of labels that apply to them. So we’ve created a repeating group that lists all the available Labels and each box in the repeating group has a checkbox.
You would expect it to be easy, then, to set the list of Labels that apply to your Pro by choosing those for which the checkbox in the repeating group is checked. But that doesn’t work…

The checkboxes appear not to be linked to any dynamic data. How to link them with the Label objects in the repeating group’s boxes?

Thank you

Right, it’s a bit tricky to refer to the checkbox, as it only exists in the context of the repeating group’s cell. Now what you can do is use a ‘Input’s value is changed’ event on the checkbox, and then add/remove the label to the current Pro. If you use a condition on the event you’ll know whether you should add or remove the Label.

Makes sense?

This approach could work if we were updating a pro, but the object of the form is to create one. So before we click the "submit"button there is no instance of our Pro to add or remove labels from.
To use this approach we could cut the form in 2, start by creating the Pro and add labels to it in a second page, but it isn’t ideal.
Is there another way?

well you could use a condition that checks if there is a pro that exists, and if not create a new one. no?

Seems it doesn’t work so far…

I created a new page, so then we can actually add the Labels to the an existing Pro. But when I do, “Make changes to a list of Labels” then I put in list to change “Current page’s pro label”. Then for “Logo” I put the “Current cell’s label’s logo”. But it doesn’t save the one I’ve checked through the checkbox.

There has to be something weird with your settings. Why don’t you put that in a group, instead of a page, that’s more flexible, and then access the parent element’s Pro? Try that and if that doesn’t work email us at [email protected]

Did you ever get this to work? I am struggling with something similar - I have a list of Food Types in a Repeating Group (A) and want to be able to check the box to select them in a search for another Repeating Group (B) that displays all Food Items where the Food Type is one of the Food Types with a ticked checkbox in the Repeating Group (A).

@emmanuel - I tried adapting the workflow for the page but can not ‘send’ the Food Types (that have been checked) from Repeating Group (A) to be a constraint in the search for Food Items in Repeating Group (B).

What is the easiest way to achieve this please?

Thanks

1 Like

This still seems unnecessarily hard for a very common task. Are there any new developments here?

I’m trying to let a user select weekdays (displayed as a repeating group with a checkbox in each group) and adding selected weekdays to a new thing that is being created. I haven’t found a way to set the list of weekdays on the thing to the selected weekdays.

I have:
Weekdays set list RepeatingGroup Weekday’s List of Weekdays

It’s missing:
whose Checkbox is checked

Right now it’s simply adding all Weekdays…

If you can reproduce the situation on the public forum app it’ll be easier to help for other people.

Is something like this what you’re looking to do?

@NigelG created this example:

4 Likes

Yes! That did it. Thank you!

(I still feel like this should be more of a built-in functionality.)

2 Likes

Thanks faye and nigel. I was trying to find out how to remove an item from a state list and the filtered option that you’ve used does it. Would be more intuitive to have a ‘plus item’ and ‘remove item’ for list editing.

:plus already exists.

To do the remove you set the state to a search filtered where the thing’s uniqueid <> the selected thing’s uniqueid. i.e. everything except THIS unique id.

1 Like

I think this is a related question, so I’m replying to this thread:

I have an element state which is a list of strings. When a new item is selected, I can easily add to the list using :plus. When I want to remove though, I see no way to do it as :filtered isn’t an available function for a list of strings… Am I missing something?

This example was what fsboehme needed, and I need, but it’s blank now. can anyone point me to a resource explaining how to use checkboxes inside repeating groups?

I think the page name was changed - Here’s Nigel’s example:

If you have any questions about how to set it up in your app feel free to let me know!
(*Thanks for pointing this out, I just edited my previous post’s link as well)

2 Likes

It doesn’t give the option for unique ID anymore? Am I doing something wrong?

1 Like

Is it a list of Texts? If so there wouldn’t be a unique ID associated with each one since it’s not a Thing. You might be able to use:

The only tricky thing is that if the List of Texts has to contain two Texts with the same value (such as “Blue” as one text, and “Blue”, as a second Text), unchecking one of those items would remove both of them from the custom state list (I think!).

It is in fact a text and it’s forcing my constraint to be a yes/no although I didn’t make my state a yes/no - I made it a text. I’m trying to figure a workaround…

Ohh hmm, that’s odd! Can you share a link?