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 / Patch to update a reco...
Power Apps
Answered

Patch to update a record in a Sharepoint list

(0) ShareShare
ReportReport
Posted on by 291

Hi,

I have a SharePoint list that I use to collect data from onsite audits. I have a gallery that displays the completed audit information where you can click though to display the details from a selected gallery item:

AuditGallery.jpg

The Action Required box on the second screen is populated from the background SharePoint list for the selected item:

AuditGalleryPage2.jpg

I have a Patch function on the update button that I want to update the Audit Type and Action Required (you can't change the image at the moment, that will be phase2!). The code is below:

Set(
 varPatchAudit2,
 Patch(
 'Hygiene Fabrication Audits',
 Defaults('Hygiene Fabrication Audits'),
 {
 
 AuditType: Dropdown1_1.Selected.Value,
 Title: Dropdown1_1.Selected.Value,
 ActionRequired: ActionRequiredInput_1.Text,
 TaskStatus: "Not started",
 AssignedBy: If(
 Dropdown1_1.Selected.Value = "Fabrication",
 FabManager,
 HygManager
 ),
 AssignedTo: "Unassigned"
 
 }
 )
);

My problem is that it is that the update is not registering anything new, i.e. if I change the Audit Type via the dropdown or the text in the Action Required, the background list is not changing. Either the Patch is not working or it is putting back the same information without picking up the changes.

Any ideas what I am doing wrong?

Thanks,

Izzy.

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

    Hi @IzzyWizz ,

    As I can see in the below-mentioned Code is like you are patching the Choices Field but you Passing value like a text.
    SO If your Source having FIeld "AuditType" is Choice Field then you can Patch Value Like Below.

    AuditType:{
     Value:"Submitted",
     '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"
     }

    The same thing is Applicable to Person Field also.
    Like for the Field -  Field (If your Source Having "AssignedBy" field as a Person or Group Type)

    //AssignedBy
    AssignedBy: {
     '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
     Claims: "i:0#.f|membership|"&Lower(User().Email),
     DisplayName: User().FullName,
     Email: Lower(User().Email),
     Picture: User().Image,
     Department: "",
     JobTitle: ""
    
     }


    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."



  • IzzyWizz Profile Picture
    291 on at

    Hi,

    No, Audit Type is a text field, I just use a dropdown to limit the options for the text that people can input. I want the text that I have already patched to the Audit Type and Action Required fields to be updated with the new information, replacing what has successfully patched there previously.

    Izzy.

  • Verified answer
    Vijay Tailor Profile Picture
    2,961 on at

    Hi @IzzyWizz ,

    If you want to update the existing record on change then Instead of Default you can use like below.
    You need to Pass the ID of that record that you want to Update. 
    For reference - See below Image

    VijayTailor_0-1601892583195.png

     

    Thanks,

    Vijay

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 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 181 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 112 Super User 2026 Season 2

Last 30 days Overall leaderboard