cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DanNik
Level: Powered On

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
Community Support Team
Community Support Team

Re: Want to set DataCardValue with button

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.
4 REPLIES 4
Super User
Super User

Re: Want to set DataCardValue with button

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
DanNik
Level: Powered On

Re: Want to set DataCardValue with button

I think I dont understand.

 

I have to put the updatecontext on the button.

But how it acceses the datacard?

Community Support Team
Community Support Team

Re: Want to set DataCardValue with button

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.
MK1
Level: Powered On

Re: Want to set DataCardValue with button

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
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 109 members 4,898 guests
Please welcome our newest community members: