Filter a repeating group by

Hi, I’m having a repeating group with a category assigned, and I want each repeating group to show a list of elements based on the category.

An example is: A repeating group with locations filtered by country.
In each location there is a country assigned from a database with counties.

Then the repeating group should only show a list with location that has the specific country selected.

I have tried to do a search for, but it somehow did not work…

Hi there, @vyork… I know you said you tried this, but what you described should be as simple as searching for locations with a constraint on the search where a location’s country equals an input’s value (that is, the input element on the page where the country is being selected). I’m not sure why that didn’t work for you, but if you can share some screenshots of your setup, I’m sure someone would be able to help you figure it out.

Best…
Mike

Hi Mike, I don’t have an input element on my page, I want this to be done static (In the backend), and then have different repeated groups on my page.

Sorry, but I don’t know what you mean (maybe someone else does, though) by static (in the backend). If you can provide more details and screenshots, that would probably help.

I want to have all the items in the same database, and then add a “Tag” like homepage as the category and then show that in the repeated groups.

Does that makes sense?

Hmm, I’m still not getting it.

Okay, that’s easy enough… I assume you aren’t stuck there.

I don’t know what that means. If you are just trying to have multiple repeating groups on a page with each group showing things that are tagged with a different category, then add multiple repeating groups to a page, and in their data sources, add a constraint to the search to show the things from a specific category.

Yes, it’s about the constraint.
I have made the repeating group and selected the database and it worked, but I want to filter it based on a field in the database. Do you know how I can achieve that or maybe there is an easier way?
I have made the databases like this.



What type of field is Strategy Category? I assume it is linked to the Strategy Category data type?

I would likely be using an option set for the categories. Do you need to use a custom data type? By using a custom data type, you are going to have to do a search in the constraint for the first thing in the Strategy Category data type where the Category = Homepage. Using an option set would make things easier, in my opinion.

Search for Strategy Cards:
Add Constraint to RG Strategy Cards:

1st variant :“Strategy Categories = RG’s Strategy Categories’s Category’s(Custom state, Type= Strategy Categories) Category”.

2nd variant: Strategy Categories = Dropdown’s value
where the dropdown data source is Strategy Categories

Example: In this case, the Strategy Categories named as the “Type”

I would create an option set that looks like this…

Then, you would need to delete your existing Strategy Category field in the Strategy Card data type and create a new field that links to the option set.

With that setup in place, the constraint on your search would be as simple as this…

Hi, Mike
That was also my first thought but for some reason I can’t select the option.
How do you get acces to the options?



If you are using an option set, you don’t need the Strategy Category data type. So, you could delete that data type, and you would link the Strategy Category field in the Strategy Card data type directly to the option set, and you would be good to go.

Wow great, that worked! Thank you so much. :slight_smile:

1 Like