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

Notifications

Announcements

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

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)
  • hkcalvinwong Profile Picture
    2 on at

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

  • 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?

     

  • RandyHayes Profile Picture
    76,297 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.

  • Community Power Platform Member Profile Picture
    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,297 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
    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

  • Verified answer
    RandyHayes Profile Picture
    76,297 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.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 401

#2
WarrenBelz Profile Picture

WarrenBelz 334 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 325 Super User 2025 Season 2

Last 30 days Overall leaderboard