Forum Academy Marketplace Showcase Pricing Features

Default value for URL param

I have a page that when loaded shows all data from a table on a repeating group with infinite scroll. This page allows to refine the search and when the user choose something, he navigates to another page. If he hits the back button, he goes back to all the items, loosing the search he had made.

I’m trying to solve this using URL parameters which is working better than I thought in some aspects. It does not fully reload the page apparently which is great. The problem is when no search was made… the values are extracted from URL on page load and then they are used on search criteria of repeating group. And when they are blank I’m getting unexpected results. How can I set a default value for URL params?

Have you tried in the Workflow to set it via When page is loaded?

I tried to find a way to test the URL parameter and then set a different value on the destination if the param is null. And yes, in the workflow. But I didn’t find a way. One custom state is set to be equal the param but I can’t test it before. Do you know a way to test the URL param?

Ah sorry no - I’ll have to think about it - maybe someone else knows though!

Could you create a workflow which is “When page is loaded and URL value is empty” --> Go to page [same page], and set the default value to be what you need?

For example, if the page name was ‘testing’:

Oh yes @fayewatson, I thought about that but the reason I want to avoid is because I actually have a set of parameters, and some of those parameters can also be a list. So it would work for the first session on the page but it would get very complex creating a list of workflows for every condition of which parameter(s) is empty. So if I could avoid that I’d be glad.

Do they need to navigate to another page to select something, sounds like you maybe need to make that selection from a popup or a hidden group that appears for only this purpose.

that could be an option @DaveA. It’s like an ecommerce. On Amazon you refine your search on the left menu, click on a product but if you don’t like you hit the back button to check for another and your previous selection is still there. It’s basically what I’m trying to do.

1 Like