How to pass value of a slider from one page to another? (Using URL is fine, but I can't make it work.)

Hi all, I have a slider which controls dark mode for my app. The slider has a minimum of 0, and a maximum of 1, and a stepper of 1 which results in a slider with either a value of 0 or 1.

All of the conditions of the design elements respond to this perfectly.

However, when I navigate between pages (all pages have the slider in a static location) I’m not sure how to pass the value of the slider from the previous page.

Here are the slider properties.

I’ve tried passing it by creating a key in the workflow like this…

pageactiveslider

Passing the value with the key in the URL doesn’t work either… a value of 1 should be darkmode with black background and white text.

slidervalue1

How can I achieve this?

yes it does as long as the URL parameter value is actually in the URL, which I expect based on your screen shot it is…what is not working, or more than likely not put in place is the extraction of that URL parameter value.

On the slide element that you have on the pages, which by the way, if it is on every page, you should think about making it a reusable element if you can, but ultimately the point here is that on the slider, you need to set the initial content to the URL parameter value using the Get Data from URL operator in dynamic expressions.

For it to work properly you should actually create a condition on the slider, make that conditional expression when the URL parameter is not empty and the property to change is the slider element initial content which should be set to the Get data from URL.

Thanks so much for the response. I understand what you’re saying, I think…

I understand the part about the slider getting it’s value using Get data from URL I think, but I don’t understand how to correctly send the data from the previous page’s slider value to the URL on navigation.

This is how I have each “on click” workflow for navigating between pages, which I THOUGHT sends the current value of my SliderInputA as the key “slider”.

Is THIS the correct way? (Image below.)

@boston85719 , implementing the changes in the last photo of my last reply gave the desired outcome! My slider choice of 0 or 1 (light or dark) is now persistent between navigating pages. Thanks so much for setting me on the right path.

I AM going to look into making this a reusable element and handling this the “right” way, but this method was just a stopgap. (I’m implementing user login and making their layout and design choices persistent across logins using database in a few weeks, this was just to get me through.)

1 Like

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