cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Community Support
Community Support

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.

View solution in original post

4 REPLIES 4
Highlighted
Community Champion
Community Champion

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
Highlighted
Frequent Visitor

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?

Highlighted
Community Support
Community Support

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.

View solution in original post

Highlighted
Helper IV
Helper IV

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
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,542)