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 / Multi-Attachment Contr...
Power Apps
Unanswered

Multi-Attachment Control: Patching Multiple Attachments Issue

(1) ShareShare
ReportReport
Posted on by 29
Hello, I am solving the following problem.
 
I have an application in which there is a form and two attachment controls, how to ensure that attachments are sent from both controls. The data is saved in a Sharepoint list
 
Here is the error message :  
SubmitForm(EditForm);
ResetForm(EditForm);
Set(UserPhoto, Blank());

// Combine attachments from both controls into a single collection
ClearCollect(
    CombinedAttachments,
    DataCardValue23.Attachments,
    DataCardValue29.Attachments
);

// Ensure the combined collection is formatted as a table of attachments
ClearCollect(
    FormattedAttachments,
    ForAll(CombinedAttachments, {Name: ThisRecord.Name, Value: ThisRecord.Value, DisplayName: ThisRecord.Name})
);

// Patch the combined attachments to the SharePoint list
Patch(
    CVRecords,
    Defaults(CVRecords),
    {
        Attachments: FormattedAttachments
    }
);
Problem is in Patch method : 
The errors in the expression are that the Patch function is receiving a Table type argument '{Attachments}' instead of the expected 'Table (Attachment)' type.
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,049 Most Valuable Professional on at
    You cannot Patch attachments other than using Form.Updates which is really little different functionally in your case from submitting the form. Two controls are also going to be problematic as you only have one target field and the second control will simply overwrite whatever was saved with the first one.
    There may be a (complex) path using Power Automate, however using one attachment control would be far easier.
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard