View data based on selection

Hi there. I have been racking my brain trying to figure this out but I am struggling with the conceptual structure. What I am essentially trying to do is have a user select categories from a RG by clicking a checkbox.
image
When done a button below the RG is clicked. This should then show a new RG with only the Vendors that have the same categories as selected in step one.

The set up is as follows:

I have an Option Set of Categories with an image as an attribute. Then linked to the vendors:
image
Could anyone please give me some pointers on how to start.

Thank you

Hi there, @sebastianvangreunen… I made an example that does what you described. The example starts with a custom state that holds the selected categories (note that I put the custom state directly on the index page).

Then, I have two workflows events associated with selecting a category via a checkbox in the category repeating group. One of the events adds the selected category to the custom state when the custom state does not contain the category. Here is the set up of that event and its associated action.

The other workflow event associated with the checkbox element removes the selected category from the custom state when the custom state contains the category, and I’m sure you can figure out the set up of that event.

Finally, when the Done button is clicked, a workflow action clears the list in the vendors repeating group, and a second action displays a new list via the following data source and advanced filter.

Note that there are no constraints on the search for vendors in the data source, and if you haven’t turned on the experimental parentheses feature, you should do that.

Hope this helps.

Best…
Mike

Wow Mike, thank you. You have opened up a whole new world to explore.
The functionality is working now, but I have noticed an issue.

Some of the vendors have multiple categories (sorry probably should have clarified)
Vendor A - Cat 1, Cat 2, Cat 3
Vendor B - Cat 1
Vendor C - Cat 4, Cat 5

When I select a single category it works partially by showing only vendors with a single category that matches the search.
When I select multiple categories no vendors are displayed.
Any ideas?

I tested that setup pretty thoroughly, and I assumed vendors would have multiple categories. So, selecting multiple categories should show vendors who have all of the selected categories. Using the data in your last reply, selecting Cat 1 should show only Vendor B, while selecting Cat 1, Cat 2, and Cat 3 should show Vendor A. If it isn’t working that way for you, can you share screenshots of your setup?

Hi Mike. Thank you

The issue is that I need Vendor B & Vendor A to show when I select Cat 1. It does correctly match Vendor C if I choose all its Categories but I would like it to only need to match one category and display, if that makes sense. So Vendor A should show up when selecting Cat 1, Cat 2 or Cat 3

Ah, now I get it, and shame on me because I should have trusted my gut (I actually thought that was going to be what you wanted), but I decided to take this statement from your original post literally.

If you had been paying me, I definitely would have clarified that requirement. :slight_smile:

Anyway, that actually makes things easier, and if you change the advanced filter to this, you should get the desired result.

1 Like

You are a gem, thank you so much. It worked!

1 Like