Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

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:
  • Suggested answer
    mmbr1606 Profile Picture
    12,112 Super User 2025 Season 1 on at
    Trying to add an attachment without using a flow or a form
    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
  • Suggested answer
    WarrenBelz Profile Picture
    146,668 Most Valuable Professional on at
    Trying to add an attachment without using a flow or a form
    Anchov is correct - the attachment field can only be accessed by a Form submission (either SubmitForm or Patch(Form.Updates) or using Power Automate.
  • Anchov Profile Picture
    1,984 on at
    Trying to add an attachment without using a flow or a form
    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.

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,668 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard