Creating a search filter triggered by a button

Hello,

I have a search page with a filter as per this image:

It works well, but unfortunately the ‘search’ button is pretty much redundant. I did get it working with the seach button (by creating a new 'display list when you click the search button, or a new ‘display list’ when you click ‘recently added’ AND an address is added, or a new ‘display list’ when you click ‘lowest price’ AND an address is added etc.), but this ended up being quite a few actions and nowhere near as lightweight.

I have a repeating group which displays all search results, and it has this filter on it:

Address is within miles box’s value miles of search box’s value, so as soon as one of these values has been entered, the search begins (which is annoying because until I enter a ‘miles’ value, there are 0 results). That’s why I’d like it to be triggered by the search button.

Any way to do this nicely?

Thanks

1 Like

I had this issue once, you can solve it by creating two custom states on an element such as the search box, one for postcode and one for miles. Set your results group to use the custom states’ values rather than the search box values. Then add a workflow that sets the custom states to the search box values when you click the button.

Thanks @dambusmedia, I managed to clean up the workflows quite a bit but then I implemented your suggestion and it’s working great.

Do you have any idea on the server toll that ‘set state’ has vs ‘display list’?

Thanks :slight_smile:

Custom states are entirely client side I believe, so there shouldn’t be any server toll

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.