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 function error
Power Apps
Answered

patch function error

(1) ShareShare
ReportReport
Posted on by 39

Hi,

I’m currently working on an app where I use the Patch function to update records in a data source (specifically, a SharePoint list). However, I’ve encountered an issue, and I’m reaching out to seek your expertise.

Here’s the relevant part of my code:

Patch(
    DMAT,
    Defaults(DMAT),
    {
        'Asset Number': Value(DataCardValue31.Value), // This is a number
        'Asset Type': DataCardValue32.Selected, // Choice
        'Calibration Expiry Date': DataCardValue35.SelectedDate, // Date
        'Device Photo': Image2.Image,  // Image
        'Equipment Condition': DataCardValue37.Selected,  //Choice
        'Equipment Status': DataCardValue38.Selected,  //Choice
        'Frequency of Calibration': DataCardValue39.Selected,  // Choice
        'Item Description': DataCardValue30.Value // Single line of Text
        'Purchase date': DataCardValue26.SelectedDate,  // Date
        'Serial number': DataCardValue42.Value,  // Single line of Text
        'Test Equipment': DataCardValue43.Value,  //  This is a Boolean
        'Value RM': Value(DataCardValue27.Value),  //  This is a number
        Brand: DataCardValue20.Value // Single line of Text
        Model: DataCardValue21.Value,  // Single line of Text
        Plant: DataCardValue41.Selected,  // Choice
        Category: DataCardValue36.Selected,  // Choice
        Custodians: DataCardValue28.SelectedItems,  // Person
        Healthiness: DataCardValue29.Selected,  // Choice
        'Tolerance or Accuracy': DataCardValue70.Value,  // Choice
        NFC Tag: DataCardValue40.Value,  // Single line of Text
        Attachments: DataCardValue33.Attachments
    }
)Khairul_Amri_0-1720149912461.png

 

The issue I’m facing is there are specific records for which it fails to pass along the data.

I’ve looked for patterns among the problematic records, but I haven’t been able to identify any consistent reasons why only certain records fail to submit.

Could you please review my code and provide any insights or suggestions? I’d greatly appreciate your help in resolving this issue.

Thank you in advance for your time and expertise! 🙌

Best regards,

Categories:
I have the same question (0)
  • anandm08 Profile Picture
    1,936 Super User 2024 Season 2 on at

    hi @Khairul_Amri ,

    try this:

    Patch(
     DMAT,
     Defaults(DMAT),
     {
     'Asset Number': Value(DataCardValue31.Value), // This is a number
     'Asset Type': DataCardValue32.Selected.Value, // Choice
     'Calibration Expiry Date': DataCardValue35.SelectedDate, // Date
     'Device Photo': Image2.Image, // Image
     'Equipment Condition': DataCardValue37.Selected.Value, //Choice
     'Equipment Status': DataCardValue38.Selected.Value, //Choice
     'Frequency of Calibration': DataCardValue39.Selected.Value, // Choice
     'Item Description': DataCardValue30.Value, // Single line of Text
     'Purchase date': DataCardValue26.SelectedDate, // Date
     'Serial number': DataCardValue42.Value, // Single line of Text
     'Test Equipment': DataCardValue43.Value, // This is a Boolean
     'Value RM': Value(DataCardValue27.Value), // This is a number
     Brand: DataCardValue20.Value, // Single line of Text
     Model: DataCardValue21.Value, // Single line of Text
     Plant: DataCardValue41.Selected.Value, // Choice
     Category: DataCardValue36.Selected.Value, // Choice
     Custodians: DataCardValue28.SelectedItems, // Person
     Healthiness: DataCardValue29.Selected.Value, // Choice
     'Tolerance or Accuracy': DataCardValue70.Value, // Choice
     NFC Tag: DataCardValue40.Value, // Single line of Text
     Attachments: DataCardValue33.Attachments
     }
    )
  • Verified answer
    WarrenBelz Profile Picture
    154,530 Most Valuable Professional on at

    Hi @Khairul_Amri ,

    Apart from anything else in there that may be incorrect, you cannot Patch Attachments other than with FormName.Updates. You need these on a Form and then

    Patch(
     DAT,
     Defaults(DMAT),
     {
     'Asset Number': Value(DataCardValue31.Value),
     . . . . . . . . .	 
     NFC Tag: DataCardValue40.Value
     },
     YourFormName.Updates
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

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

#2
Haque Profile Picture

Haque 273

#3
Kalathiya Profile Picture

Kalathiya 232 Super User 2026 Season 1

Last 30 days Overall leaderboard