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 / 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:
I have the same question (0)
  • 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
    153,084 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,605 Super User 2025 Season 2 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

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
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard