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 / Updating a field in a ...
Power Apps
Unanswered

Updating a field in a SharePoint List with the Update function

(0) ShareShare
ReportReport
Posted on by 17

I see many posts asking about "the patching function" to update a SP list, not sure what that is, I'm after just a simple "Update" function that I can't seem to get working.

 

I have a simple 'toggle' button on my app that if toggled, I want a field in the list to be updated with some text.

My list is called "ApprovalList" and there is a text column called "ISO_Approve"

 

When the button is toggled, it merely needs to update the corresponding SP List item's ISO_Approve value to "Approved".

 

On the toggle button's "OnChange" property, I have the following code...

Update(ApprovalList.ISO_Approve, "Approved")

 

I've also tried, among many other iterations...

Update(ISO_Approve.Text, "Approved")

 

I've also tried using the Set and Patch functions and can't get it working, any clues?

Categories:
I have the same question (0)
  • Vijay Tailor Profile Picture
    2,961 on at

    Hi @stevenspray ,

    I did not understand like, How you updating value back to SP.

    Basically, if you want to update any record in SP. then you need an ID for an update or Patch the Record.

    Basically, Patch COde looks like that.

    See the below Code.

    // Update the Recrod using Patch
    Patch( 
     Sharepointlsitname,{
     ID:varCheckDuplicate.ID,
     ApproverCOmment: "Approaved - Here is the approaved Comment"
     }
    );
    
    //Create the Record Using Patch.
    
    Patch( 
     Sharepointlsitname,{
     Defaults(Sharepointlsitname),,
     Status:{
     Value:"Submitted",
     '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"
     }
     }
    );


    Thanks,
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

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

    @stevenspray 

    Your use of the Update function is incorrect.  To use Update, you need to supply three parameters, the dataSource, the OLD record, and the New Record.

    You will also need to supply a valid record (using the { } notation).

     

    What you might want to consider is the UpdateIf function.  In this you can supply the Datasource, the criteria for what to update, and the changes you want to make.

    UpdateIf(
     ApprovalList.ISO_Approve, //Datasource
     ID=yourCurrentRecordID, //Criteria
     {ApprovedColumn:approvedColumValueYouWant} //Record changes
    )

     

    You will need to, obviously, replace the above names to those valid in your app and data source.

     

    I hope this is helpful for you.

     

  • stevenspray Profile Picture
    17 on at

    Hi RandyHayes

     

    Thank you, I was unaware of the three required parameters. What is the OLD record is blank? I think the UpdateIf might be the wrong way to go about it, I'm not sure.

     

    I'm trying to type your syntax and it's just not working, where do I get the ID from? Also, when I type 

     

     Patch(ApprovedList.ISO_Approve PowerApps changes that to Patch(ApprovedList.'ISO_Approve' including some '' is that intended?

     

    Also, I see you mention "ApprovedColumn", this is ISO_Approve, correct?

  • stevenspray Profile Picture
    17 on at

    Hi VijayTailor

     

    Thanks for your input, I have now used the curly brackets and don't see the squiggly underlined red error in the code anymore, but I still see a red "X" error mentioning something about unexpected characters. I do think my syntax is slightly wrong. I am now using....

     

    Patch(ApprovedList,{'ISO_Approve': "Approved"}

     

    I can't seem to fit the "ID" part of the syntax in anywhere, where do I format this?

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 377 Most Valuable Professional

#2
11manish Profile Picture

11manish 165 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 110 Super User 2026 Season 2

Last 30 days Overall leaderboard