Remembering Search Items

I have a page that searches a dataset. The found records link to a details page. Of course that’s the easy part.

However when you go back to the search page you have to enter all your search criteria in again. Is there a way to have it remember the last entered search so it doesn’t have to be entered every time?

Hi Brad,
Yes, just store the search term in a query parameter, using the state management.

Thanks Teodor, you make it sound so simple. :wink:

I assume it would look something like:

1 - set parameters based on value of the form fields
2 - set the default value of the form fields to those parameters

Is that close?

Input > dynamic attributes > value > set the query param value, and then select the input > on keyup with debounce like 300ms you set dynamic event > set query param value and select the input value there :slight_smile:

I must be missing a step …

I added my Query Manager Variable

Selected my input field

On my keyup event I have:

But it isn’t working. I am obviously missing something.

What is not working, exactly Brad?

When I go back to the search form page the value in the search field is blank.

Is the value added to the query param at first place?

How would I find that out?

Brad… When you type something in the search field, does it get added as a parameter in the address bar after the URL?

Yes it does. I can display the variable on the page …

27%20AM

And itt does show in the address bar …

04%20AM

So, next question - how do you redirect back from the details page to the search page?

Just a link to the search page?

Well, that won’t work as the link doesn’t contain your url params.
Use javascript:history.back() instead

Alright, I was hoping to avoid using the history, but if that is the only way I will live with it.

Thanks again for the great support!

1 Like

Then you can store the search values in a session, not in a query parameter :slight_smile:

1 Like

Problem number 2 …

How do I set the variable or session based on the value of a dropdown? There is no ‘keyup’ for a dropdown menu.

Try using the on change event, currently on my phone so I can’t recall how was it exactly called :slight_smile:

1 Like

‘Value Updated’ seems to work. I have it working perfectly with variables now. I want to try and do it using session variables though. But at least I have a way to make it work.

Thanks again, I really owe you guys beers some day.

1 Like

Hi Brad, it would be great if you could show clearly the steps needed so we can all benefit :smiley: