web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Change a datacard fiel...
Power Apps
Answered

Change a datacard fiels value with a button

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

i'm struggling with updating a datacard value with a button. I confirmed that the form is in edit mode.

 

The field on the data card is named Progress  and the command on the button is UpdateContext({Progress:"100"})

 

This is not working.

 

Looking in the fora or other webpages did not help.

 

Thanks in advance

 

E.Traas

Categories:
I have the same question (0)
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @ETSoft 

    You cannot update things that way in PowerApps.  Your controls all "consume" values from other places.

    If you maintain the concept that you have of having a button to update a field there is a few steps you will need to take.

     

    First, your button will update a Variable - so, in this case, your OnSelect Action will be:

      UpdateContext({varProgress:"100"})

     

    Next, your DataCard will need to consume the variable.  So, you would change the Default on the DataCard as follows:

      If(!IsBlank(varProgress), varProgress, ThisItem.whatEverFieldItIs)

     

    The trick on this is that you will absolutely need to "reset" the value of the varProgress when you change items to Edit.  You can do this wherever you submit the form, or even on another button or action.  But, wherever, you will need to do this:

      UpdateContext({varProgress:""})

     

    Also note...since you used "100" in your example, this all assumes you are using a text field.  If it is numeric, you will want to use the Value(varProgress) above.

     

    This is just one of several ways to go about what you are trying to do.

    Hope it helps get you going.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Oké thanks this is working, 

    I noticed when this variable is set once it keeps the value, I need to clear that value after the screen is closed. I now use

     

    SubmitForm(Form1) & UpdateContext({varProgress:""}) & Back()

    Adding  UpdateContext({varProgress:""}) after the Datacard thing is not working either.

     

    Regards

    Erwin

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @ETSoft 

    Erwin, 

    Your formula should be:

    SubmitForm(Form1); UpdateContext({varProgress:""}); Back()

    I'm not understanding what you mean by:


    Adding  UpdateContext({varProgress:""}) after the Datacard thing is not working either.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi,

     

    you use the ; but that gives me an error , is this something with Windows 10 settings ( I'm in the Netherlands )

     

    Only the & is not giving an error

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @ETSoft 

    Ah...then for you I believe it is ;;

    What you are doing is formula chaining.  See this link for some more info.

  • StarzAaroni Profile Picture
    2 on at

    Hi There. I haver tried this Solution but what i have noticed is that it also changes the datacardvalue fields for the other records on the list when you page down since they are using the same form. how does one go around this?

     

  • hkcalvinwong Profile Picture
    2 on at

    yes this method no longer working !!! need a newer solutions.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 545 Most Valuable Professional

#2
Haque Profile Picture

Haque 314

#3
Kalathiya Profile Picture

Kalathiya 234 Super User 2026 Season 1

Last 30 days Overall leaderboard