Ravi Anand
Ravi Anand

Reputation: 5524

Hoe do you update a Control property from another Control's action

I am trying to on/off a toggle button on a button OnSelect Action in PowerApps.

Its not working. I have tired code as follows but it did not work:

UpdateContext({DataCardValue8:DataCardValue8.Value=false}) //or
UpdateContext({DataCardValue8.Value=false}) //or
UpdateContext({DataCardValue8.Value:false})
//toggle button control Id is DataCardValue8

enter image description here

Upvotes: 0

Views: 4044

Answers (1)

Meneghino
Meneghino

Reputation: 1021

You should set the toggle's Default property to a variable, say MyToggleValue

Then you should set the button's OnSelect to: UpdateContext({MyToggleValue:!MyToggleValue})

Upvotes: 1

Related Questions