Forum Academy Marketplace Showcase Pricing Features

How to update the data source in a repeating group when a category has been selected

Working on a page where I have a repeating group of book categories showcased. There is also a dropdown menu where users can select the category they want to dive deeper into.

Categories and books are separate data types but each book has a text field where the category id is present.

My question is if there is a way to update the repeating group to show entries from a different data type once an action has been taken? So for example once someone selects the dropdown “fictional”, the books in the category would show up in the repeating group.

Or do I have to create a new repeating group that shows books as the data source and a kind of hide show conditional thing?

Struggling with this for a while so any tips would be much appreciated.

Thanks,

Hi there, @brookelustig… you can change the data source of a repeating group through a workflow action, and you can put that action in a workflow that runs when an input’s value is changed.

So, when the category dropdown is changed, display a list in the repeating group where the constraint on the search is the dropdown’s value.

Hope that makes sense, and I hope it helps.

Best…
Mike

You can’t change the Data Type of a repeating group (RG) but you can change the source by sending a list to it (display list as mentioned above) or with conditionals.

Does the RG list categories or books? Your first sentence says categories.

The Category field on your Books Data Type should be of type Category (and check List of Categories - if a book can be under more than one) instead of text.

With that, I would have the RG Data Type be Books and create a custom state on the RG for Category. When the dropdown is changed have it set the state of the RG. Use conditionals to show if the RG state is empty, the RG lists all books. If the RG state contains fictional, the RG would list books whose Category field contains fictional.

@mikeloc thank you for that detailed explanation, I’ll give that a try.

@telaholcomb I think you hit the nail on the head on why I’m struggling with this. The RG list is currently a list of all categories (data source: categories) but if I’m understanding you correctly the RG should be a list of categories (data source: books)?

I tried doing it that way the first time but I would have the issue that each category would show up several times (as many books that were listed in that category). So for example if fictional have 6 books the category fictional would be listed 6 times.

Thanks again for all the advice and tips!

RG type should be Books (because you want to show/list the books, right?) and source would be Search for Books (constraint based on category)