cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

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
Highlighted
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
Highlighted
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

Highlighted
Frequent Visitor

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!!!

Highlighted
Frequent Visitor

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
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (4,629)