cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper IV
Helper IV

set slider default with variable and show that value

Hi Colleagues, I've got a simple problem but I can't figure it out. I'd like the slider button to jump to the value given: 

//onchange

 

If(Slider1.Value <= 50;

UpdateContext({setSliderValue: 0});;

 

If(Slider1.Value >= 50;

UpdateContext({setSliderValue: 100])

)

)

 

Default = setSliderValue

ThankYou







 

10 REPLIES 10
Highlighted
Super User III
Super User III

Please give you explain further. Is the UpdateContext on a button and are you placing the value in a Textbox

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Highlighted

ThankYou, This is the slider "Onchange" event:

 

If(Slider1.Value <= 50;

UpdateContext({setSliderValue: 0});

//do this....

If(Slider1.Value >= 50;

UpdateContext({setSliderValue: 100})

//do else...

)

)
And the "Default" of the slider is the variable: SetSliderValue

If i click on the slider on 30 or 60 the slider handler goes to 0 or 100, but if i drag the slider to 30 or 60, then nothing happens...
Looks like the "Onchange" event isn't working properly.

Thankyou so much for any idea





Highlighted
Community Support
Community Support

Hi @Frans_365CH ,

Do you want the slider value jump to 0 or 100 based on the selected value of the slider?

I suggest you add a reset function after you set variable in the slider's OnChange.

Try to set like this:

the slider's Default:

setSliderValue

the slider's OnChange:

If(Slider1.Value <= 50;

UpdateContext({setSliderValue: 0});

 

If(Slider1.Value >= 50;

UpdateContext({setSliderValue: 100})

)

);;Reset(Slider1)

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted

It does work, but now he's bouncing in all directions, and that makes sense

🤣😂😅

Highlighted

Hi @Frans_365CH ,

So have your issue been solved?

If my solution works for you, could you mark my answer as solution?
Thanks!

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted

Ola,
No sorry it does not work cos, the slider is bouncing in all directions, at the end it will go to 0 or 100 but with a lot of trouble.
Thanks.

Highlighted

Hi @Frans_365CH ,

Maybe you  could consider using a Timer to reset the slider to avoid the slider too quickly.

Try to set like this:

the slider's OnChange:

If(Slider1.Value <= 50;

UpdateContext({setSliderValue: 0});

 

If(Slider1.Value >= 50;

UpdateContext({setSliderValue: 100})

)

)

the slider's Default:

setSliderValue

Timer's settings:

AutoStart: true

Repeat: true

OnTimerEnd:

Reset(Slider1)

Duration:

1000

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted

I've thought about that too, but I'm making some kind of drag and drop. I don't think that would be a solution.

More idea's 😊

Highlighted

Which is a little weird:

If I drag the slider from 100 to 80, nothing happens.
If I drag the slider from 100 to 30 it jumps to 0.

 

And vice versa

 

If I drag the slider from 0 to 30, nothing happens.
If I drag the slider from 0 to 80 it jumps to 100.

 

The event does not work within 0-50 and 50-100.

 

Can you do anything with that?

 

 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (7,938)