cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jcr2007
Level: Powered On

Increase Slider Value

Hi all,

 

I have one slider that has buttons on both sides, a minus "-" and plus "+". When users select the + button, I would like for the value of the slider to increase by one, and when a user selects the minus, decrease by one. It is a bit of a simple concept, but I am lost on how to execute. Any ideas I would greatly appreciate in advance. Thank you!

 

-JC

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Increase Slider Value

@jcr2007 

You will want to set the Default property of your Slider to a variable.  Let's say sliderValue

Then, for the increment button, set the OnSelect formula to UpdateContext({sliderValue: SliderValue + 1})

And for the decrement button, set the OnSelect formula to UpdateContext({sliderValue:  SliderValue -1})

 

This should give you what you are looking for.  One aspect to consider adding as well would be a check against the min and max of the slider control.

In that case, I would add to the DisplayMode property of the increment button the following formula:

  If(sliderValue >= yourSliderControl.Max, Disabled, Edit)

And for the decrement button DisplayMode property:

  If(sliderValue <= yourSliderControl.Mix, Disabled, Edit)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

3 REPLIES 3
Super User
Super User

Re: Increase Slider Value

@jcr2007 

You will want to set the Default property of your Slider to a variable.  Let's say sliderValue

Then, for the increment button, set the OnSelect formula to UpdateContext({sliderValue: SliderValue + 1})

And for the decrement button, set the OnSelect formula to UpdateContext({sliderValue:  SliderValue -1})

 

This should give you what you are looking for.  One aspect to consider adding as well would be a check against the min and max of the slider control.

In that case, I would add to the DisplayMode property of the increment button the following formula:

  If(sliderValue >= yourSliderControl.Max, Disabled, Edit)

And for the decrement button DisplayMode property:

  If(sliderValue <= yourSliderControl.Mix, Disabled, Edit)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

jcr2007
Level: Powered On

Re: Increase Slider Value

@RandyHayes You are the real MVP!!!!! I should also note that my slider OnChange had to be adjusted so that the global variable will update when a user slides the handle. Thank you!!!

damilola79
Level: Powered On

Re: Increase Slider Value

It increase and decrease all the gallery items quantity at the same time, is there a way to make it 1 item at a time

 

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,709)