Dynamic search based on Conditions/States

Hi Guys,

I hope somebody can help or at least tell me that the way I am doing this is the best way to do it.

So I have a list of products and I want the user to decide how this list will be filtered.
To give you an example:

The user can click on one of the buttons and the list gets filtered accordingly.
(just an example I worked here with states on the buttons. User clicks on the button and its state gets to Yes)

This works fine. However it is a bit messy and I get more and more conditions on the RG. What if I get more and more options which can coexist/get selected at the same time. Lets say the user can select: 24h Shipping, Price under 50, category x, color blue (etc.)

Do I still work here with conditions on the repeating group which selects the correct Search based on which buttons have been clicked? Or is there another way which I am not aware of at the moment?

Would be awesome if somebody could point me in the right direction.

Thanks!

I ran into something similar. How I fixed this was by creating a new field for the user in the database and just setup the conditionals on the repeating group to change according to that user’s field.

I used numbers, but you can also use text.

Then setup workflows when a user clicks on one of the tabs to change that filter field to like 1, 2, 3 etc.

1 can equal 24 shipping
2 can equal under 50
and 3 can equal price under:

Then make the repeating group filter respective to the user’s filter number.

Even if the user isn’t logged, the Make changes to the current user will still work. It saves it to the user’s browser.

Let me know how this goes for you.

thanks for the reply Ryan!

I will give this approach a try. btw. Do you know if this goes against your workflow count? I would say yes because you are triggering workflows which are changing data fields (not like workflows for navigation which do not count). This could be a minus.

1 Like

You are welcome!

You are correct, it does cost a workflow. Alternatively, you can store data into an element on the page. So instead of sending it to a user’s field, you can set a state on an element.

You can use the group that’s around your tabs to store the number, then you can have the repeating group and the tabs respond to that number.

This doesn’t cost a workflow and still allows you to do that same thing.

1 Like