web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Changing toggle button...
Power Apps
Unanswered

Changing toggle button on selection of another button.

(0) ShareShare
ReportReport
Posted on by 46

I would like change the toggle button on selection of another button. I know you can make use of UpdateContext(Var: !Var) and set the default value of toggle switch to Var. But I need the toggle switch default value to remain Parent.default because that value is read from SP list upon item selection.

 

Any suggestions?

Categories:
  • chrisog Profile Picture
    213 on at

    Could you not use multiple variables? The first one is used to flag whether you want the default value to be taken from the sharepoint list, the second one to be the value you want the toggle to show when the first is false?

     

    For example, in the OnVisible of the page, have a statement declaring a variable: UpdateContext({isChange : false}). You can also declare another variable which will take the value from your sharepoint list with UpdateContext({myValue : DefaultSharepointValue})

     

    From here, set the Default property of your toggle to a conditional statement with something like: If(isChange, myValue, DefaultSharepointValue)

     

    You can then have it so that when the button is selected, it changes the isChange value to true and also inverts the value of myValue using UpdateContext({ myValue : !myValue, isChange : true})

     

    You can then reset the toggle value to the sharepoint list by using UpdateContext({isChange:false}) anywhere you feel necessary

  • Andries1 Profile Picture
    46 on at

    That makes sense!

    Is there a way to set the value of toggle to true without making use of variables?

  • v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @Andries1 ,

     

    Currently, the variable could be the best approach to modify the property dynamically because we should define the corresponding properties in the formula bar of the respective properties. 

    Best regards,

    Sik

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 397 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 354

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard