Forum Academy Marketplace Showcase Pricing Features

How to filter existing search results, and not perform a complete new search

I have a repeating group, it’s showing results from a search.

I want to now filter the results.

Now i know i can add a filter button, and then update the datasource of the repeating group through “display list in repeating group” but this is going to go back and do a complete new search, so i’m worried this will be slow. Plus i need to retype all the existing search results filters

So i want to be able to filter existing results, but somehow saying
Whatever the existing datasource is, just add this new filter to it, and therefore filter down existing results?

How can i do this?

If you display list on the RG and instead of setting the source to a new search that is filtered, you can filter the RG’s list of things.

“RG’s list of things:filtered”

That what you’re looking for?

1 Like

Firstly, thanks for all your help.

But how do i “Filter the RG’s list of things”?

Because when I click “Display list in RG” the only option there is to choose a “Data source”

So how do i make this data source say “RG’s list of things:filtered” ?

Ignore my most recent comment, i found how to do it and am now trying it.

thanks again.

1 Like

This is working exactly how you suggested, which is great.

One thing though.

When i perform a search is gives me searchresutls_X
Then when i filter, it filters against searchresutls_X (which is great), and therefore returns me a set of search results, lets call it searchresults_Y

Then when i filter again, it now filters against searchresults_Y

How can i make it so that it is always filtering against searchresults_X and not the latest filtering

Or alternatively, how could i change me UI?

I’m trying to make something like the yelp filter below.
See how you can turn on and off the filters, how could i setup that type of UI?
Where it filterest against the search results, but you can also turn off the search filter and it goes back to what it was.

Use a custom state to hold the value of the base search. Display list source would then be custom state’s value: filtered. This way, the custom state will always retain an original search and you can change filters in the display list source.

1 Like

Could you expand a little on how i would use a custom state for the base search?

I totally get the other part your suggesting, just unsure how i would use a custom state for the initial search results?

At what point would i save the custom state?

When the page is loaded?

Or when they click the “Apply Filter” button?

Sure thing. If the user is going to click a search button first before applying a filter, then do it at the search button click: set state > select an element to save this state to… create new state called base search… set what type of Thing this is a search of … check list > set the value of the state to the search.

Then when apply filter button is clicked > display list > source = element’s base search :filtered.

Now, if the search and filter are happening off a single click, then have those two actions in that same click workflow but add a condition to the set state action to only run when the state is empty.

If you have a clear search button that wipes everything, you’ll want to set state again and leave the value blank and “clear list” on you repeating group.

This make sense?


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