Hi all,
I'm wondering if someone can help with IF statement being used based on a whether a context variable I have created = true.
So the context variable is button1:true and is set to the visible property.... So if I click a button another one shows and highlights a particular object this works fine.... I then have another button which I want to patch a specific record in a datasource which is displaying in a gallery if that context variable =true. The patch function works fine without the IF statement so this part I know is working ok.
The below is what I have but I'm not sure whether I have to reference the button itself or the variable - or both?
If(button1=true,
Patch('Table1',ThisItem,{Desk1PM:Userlabel.Text}))
Thanks in advance
Solved! Go to Solution.
@MJ84 Try this:
1. On button click - OnSelect property of button, add below formula:
UpdateContext({ isButtonClicked: true })
2. On OnSelect of another button where you want to patch the item, use this formula:
If(isButtonClicked = true, Patch('Table1',ThisItem, { Desk1PM: Userlabel.Text } ))
For more information, check Patch & UpdateIf functions in Power Apps.
Please click Accept as solution & 👍 if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it 👍
@MJ84 Try this:
1. On button click - OnSelect property of button, add below formula:
UpdateContext({ isButtonClicked: true })
2. On OnSelect of another button where you want to patch the item, use this formula:
If(isButtonClicked = true, Patch('Table1',ThisItem, { Desk1PM: Userlabel.Text } ))
For more information, check Patch & UpdateIf functions in Power Apps.
Please click Accept as solution & 👍 if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it 👍
@ganeshsanapperfect exactly what I needed thank you very much I really appreciate it.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
User | Count |
---|---|
169 | |
94 | |
64 | |
64 | |
60 |
User | Count |
---|---|
241 | |
163 | |
95 | |
85 | |
82 |