Skip to main content
Community site session details

Community site session details

Session Id : xXcv51gECOa4sHxl+g5HIi
Power Apps - Building Power Apps
Answered

Toggle button automatically changes the value based on if condition

Like (0) ShareShare
ReportReport
Posted on 4 Mar 2024 04:52:47 by 32

Hello ,

I am new to toggle button, I have a dropdown which has these five different values(1,2,3,4,5). the condition is when i switch on the toggle the values should change to(100,200,300.400,500) respectively automatically . For example if i select 1  in dropdown and change the toggle the value should automatically change to 100 so and so forth. How can i do that in power app?
all advices are welcome
Thank you

Categories:
  • MG-08080656-0 Profile Picture
    32 on 04 Mar 2024 at 09:49:48
    Re: Toggle button automatically changes the value based on if condition

    Thanks . it worked

  • Verified answer
    v-bofeng-msft Profile Picture
    on 04 Mar 2024 at 09:10:54
    Re: Toggle button automatically changes the value based on if condition

    Hi @Anonym_unknown ,

     

    Please try:

    1\Set Toggle1

    OnCheck

    Set(DropDownValue,Dropdown1.Selected.Value*100)

    OnUncheck

    Set(DropDownValue,Dropdown1.Selected.Value/100)

    2\Set Dropdown1

    Items

    If(DropDownValue>=100,[100,200,300,400,500],[1,2,3,4,5])

    Default

    DropDownValue

     

    Best Regards,

    Bof

  • MG-08080656-0 Profile Picture
    32 on 04 Mar 2024 at 09:02:07
    Re: Toggle button automatically changes the value based on if condition

    When i select any number it is only giving me 100 as a value. For example.

    Anonym_unknown_0-1709542883347.png

    Selected 3 in the dropdown and switch the toggle gave me 100. how will i get 300?

  • Shawn11 Profile Picture
    152 on 04 Mar 2024 at 06:41:52
    Re: Toggle button automatically changes the value based on if condition

    The  reason is you had to set dropdown control to the list of values:[1,2,3,4,5] forgot to mention that also you need to replace the if condition with property name.

    Hope this was helpful 

  • Verified answer
    v-bofeng-msft Profile Picture
    on 04 Mar 2024 at 06:25:43
    Re: Toggle button automatically changes the value based on if condition

    Hi @Anonym_unknown ,

     

    You could set the dropdown control's items property to:

    If(Toggle1.Value,[100,200,300,400,500],[1,2,3,4,5])

     

    Best Regards,

    Bof

     

     

  • MG-08080656-0 Profile Picture
    32 on 04 Mar 2024 at 06:00:25
    Re: Toggle button automatically changes the value based on if condition

    It says, if condition have some invalid arguments. 
    Not working. anything else

  • Shawn11 Profile Picture
    152 on 04 Mar 2024 at 05:37:38
    Re: Toggle button automatically changes the value based on if condition

    In the OnChange property of the dropdown control, add the following formula:
    If(ToggleValue.Value, DropdownValues.Selected.Value * 100, DropdownValues.Selected.Value)

     

    hope this helps 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading started