Reputation: 8719
I have a global variable in PowerApps which I set onstart.
Set(CurrentItem, First(Filter('Internal Review', ID=Value(Param("ID")))))
This sets the variable CurrentItem to
{ myProperty: 1, secondProperty: 2 }
I want to update "myProperty" in the global variable on a button click. I've got this:
Set(CurrentItem, { myProperty: 3 })
but its not working.
Upvotes: 2
Views: 7216
Reputation: 1
According to your formula, your global variable (CurrentItem) is bound to the "Internal Review" source. In your example it is currently { myProperty: 1, secondProperty: 2 } but it will change automatically if the respective values are changed in the source. You cannot change it because this would break the binding. I would suggest to copy it and then apply the desired changes to the copy. Example: Set(CurrentItemCopy, { myProperty: CurrentItem.myProperty, secondProperty: 3 })
Upvotes: 0