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 / Trying to add an attac...
Power Apps
Suggested Answer

Trying to add an attachment without using a flow or a form

(1) ShareShare
ReportReport
Posted on by 19
Here is my code.  The only error is that it says "The function patch has some invalid arguments".  Can anyone tell me why this wont work? 
 
// Clear and collect existing attachments
ClearCollect(
    colAdministratorAttachments,
    First('Firearms Qualifications Administrators').Attachments
);
 
// Collect the new attachment
Collect(
    colAdministratorAttachments,
    {
        DisplayName: First(cmbNewAdministratorName.SelectedItems).FullName & ".jpg",
        Id: GUID(), // Generate a unique Id for the attachment
        Value: penNewAdministratorSignature.Image,
        AbsoluteUri: "" // This will be handled by SharePoint
    }
);
 
// Patch the item to SharePoint
Patch(
    'Firearms Qualifications Administrators',
    Defaults('Firearms Qualifications Administrators'),
    {
        Title: First(cmbNewAdministratorName.SelectedItems).FullName,
        Attachments: colAdministratorAttachments
    }
);
Categories:
  • Anchov Profile Picture
    1,986 on at
    I'm sorry, but I have never found a way to patch an attachment without using a form or a Power Automate workflow. This functionality is not supported.
  • Suggested answer
    WarrenBelz Profile Picture
    156,528 Most Valuable Professional on at
    Anchov is correct - the attachment field can only be accessed by a Form submission (either SubmitForm or Patch(Form.Updates) or using Power Automate.
  • Suggested answer
    mmbr1606 Profile Picture
    14,629 Super User 2026 Season 1 on at
    Hey
     
    This video shows the fastest and easiest way to patch attachments without flow. But u need the attachmehts Control from a form.
     
     
    Please mark as verified answer if ut helped

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
11manish Profile Picture

11manish 393 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 278 Most Valuable Professional

Last 30 days Overall leaderboard