@Pat (Pbimweb) posted a new topic, subject "Dynamic search based on Conditions/States". It read:

   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!

@ryan (Ryan Roberts) replied

    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.
    
    Screen Shot qward@example.com AM.png1572×526 34.3 KB
    
    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:**
    
    Screen Shot qward@example.com PM.png1494×998 58.3 KB
    
    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.

After which, @Pat (Pbimweb) added

    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.

@ryan (Ryan Roberts) replied

    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.
    
    Screen Shot qward@example.com PM.png1386×986 58.2 KB
    
    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.


{'source': 'discourse', 'url': 'https://forum.bubble.io/t/dynamic-search-based-on-conditions-states/5540', 'title': 'Dynamic search based on Conditions/States', 'views': 601, 'has_accepted_answer': False, 'word_count': 521, 'like_count': 2, 'reply_count': 2, 'participant_count': 2, 'posts': 4, 'tags': '', 'author': '@Pat (Pbimweb)', 'participants': '@Pat (Pbimweb), @ryan (Ryan Roberts)', 'image_url': ['https://forum.bubble.io/uploads/default/original/2X/f/f5ad927bfdb2481696289ec095b181bb0c649bcc.png'], 'created_at': '2016-08-28T17:52:20.535Z', 'last_posted_at': '2016-08-29T19:11:44.593Z'}