cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Want to set DataCardValue with button

Hey Guys,

 

I want to set a DataCardValue in the Form Edit by clicking a button.

I tried with UpdateContext but it doesnt work.

 

Can you give me any advice?

1 ACCEPTED SOLUTION

Accepted Solutions

Hi DanNik,

 

My test steps for a reference;
1. Add a Text box control.
2. Add a Button control, and set its OnSelect property as: UpdateContext({test:test+1})
3. Set the Text property of the Text box as: test
4. When clicking the button, the text in the Text box would be changed.

 

Here is the documentation about PowerApps Updatecontext function, please check it for more details:
https://powerapps.microsoft.com/en-us/tutorials/function-updatecontext/

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Community Champion
Community Champion

Hi

Updatecontext always work in "pair".

May you try on
- UpdateContext({x: " "}); Update Context({x: YourValue})

Remember, it must be "(Space)"

Hope it works for you.
Have a nice day
hpkeong

I think I dont understand.

 

I have to put the updatecontext on the button.

But how it acceses the datacard?

Hi DanNik,

 

My test steps for a reference;
1. Add a Text box control.
2. Add a Button control, and set its OnSelect property as: UpdateContext({test:test+1})
3. Set the Text property of the Text box as: test
4. When clicking the button, the text in the Text box would be changed.

 

Here is the documentation about PowerApps Updatecontext function, please check it for more details:
https://powerapps.microsoft.com/en-us/tutorials/function-updatecontext/

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helper IV
Helper IV

Hi

In my scenario,

When we try to submit a new request to Add and Remove User.

I have two buttons, Add and Remove on my edit screen.

When we click on Add button ABC datacardvalue should be null.

when we click on Remove button ABC datacardvalue should be "Remove".

And the Datacardvalue should set to null once the form is submitted.

Any ideas how to fix this would help.

 

Thanks,

Mk

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (50,521)