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 / Adding multiple attach...
Power Apps
Unanswered

Adding multiple attachment inputs

(0) ShareShare
ReportReport
Posted on by 878

So I'm having a similar issue to this 2019 one, where the person was told there was no current fix (Solved: Demanding specific attachements to be added - Power Platform Community (microsoft.com))

I was wondering if its possible to have, apart from the built-in Attachment Sharepoint input, a second one. And whatever you add here, adds to the the attachments list for that item.


Example, I have a text field that is for Company ID, and want to add in the same data card the possibility to add the Goverment TaxID.

 

Want to separate it this way so this document is easy to find, and also so I can make it required to attach something here.

 

Is it still impossible?

Categories:
  • Anonymous_Hippo Profile Picture
    1,247 Super User 2024 Season 1 on at

    Hello @WorkingRicardo 

    Unfortunately the question that you have linked still does not have a real fix - While we can manipulate the presentation to appear as separate attachments, PowerApps consolidates all SharePoint attachments into a single column.

    However, I encountered a similar problem and found a solution through Reza Dorrani's video

     

    GitHub link to download multi-attachment app displayed in video

     

    I recommend watching the entire video but if you are short on time you might want to skip to the last section where he talks about multiple attachment control.

     

    Basically what we are doing here is creating a collection and appending the file name before storing it in SharePoint.

     

    Hope this helps ! Cheers

     

  • WorkingRicardo Profile Picture
    878 on at

    Hey @Anonymous_Hippo ty for the reply!
    Ok this is quite advanced for me, i used the zip file trying to replicate what Reza did, but cannot really even create the collection of attachments. If I copy his code turned 

    ClearCollect(    colTravelAttachs;    Defaults(SharePointForm1).Attachments)
     
    I get a bunch of errors, about 10 XD so I'm guessing just pasting that is not enough. Do you know what I can do step by step to copy paste that into my app?
  • mmbr1606 Profile Picture
    14,629 Super User 2026 Season 1 on at

    hey @WorkingRicardo 

     

    i dont know if this is possible but it could be worth a try.

    It is possible, that you steal an attachment control from an edit form and put it on another screen. this has been done by a few power apps mvp like Shane Young or Reza. I also recreated it (but i only use 1 attachment control).

     

    you would most likely use the patch function to save the data to sharepoint. in the end i think even if it could technically work, they would be grouped together either way and not beeing separate.

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

     

  • Anonymous_Hippo Profile Picture
    1,247 Super User 2024 Season 1 on at

    Hello @WorkingRicardo ,

     

    I would recommend you import his code and try to see what he is doing, incase you are having difficulties you check below logic

     

    I am not sure how your application is configured but i am adding Reza's Logic below :-

     

    1) Creating Collections for Attachments

    • Place this code in the OnSelect property of the Gallery to run when an item is selected.

    It filters attachments starting with "Project" and "Travel". If you only need one type, adjust accordingly.

    ClearCollect(colProjectAttachs, Filter(ThisItem.Attachments, StartsWith(DisplayName, "Project-"))); ClearCollect(colTravelAttachs, Filter(ThisItem.Attachments, StartsWith(DisplayName, "Travel-"))); ClearCollect(colFinalAttachments, ThisItem.Attachments); 

      2) Adding Attachment Controls to Your Form

    • You'll need three controls: one for Project, one for Travel, and one combining all attachments.

    Anonymous_Hippo_0-1706649842387.png

    Since you only need one extra attachment, you can skip the Travel attachment control.

    3) Configuring the Project Attachment Control

    • Set Items to colProjectAttachs
    • For the OnAddFile, OnRemoveFile, and OnUndoRemoveFile events, Set
    • Select(btnProject)

    btnProject is a hidden button which we will talk about next 

    Anonymous_Hippo_1-1706649866112.png

    4)Setting up the btnProject button & project attachment datacard

    OnSelect

    ClearCollect(colProjectAttachs, DataCardValue7.Attachments); UpdateIf(colProjectAttachs, !StartsWith(DisplayName, "Project-"), { Name: "Project-" & Name, DisplayName: "Project-" & DisplayName }); RemoveIf(colFinalAttachments, "Project-" in DisplayName); Collect(colFinalAttachments, colProjectAttachs); 
    • Adjust the display name as needed.
    • Ensure the attachment control's default property is blank
    • For project attachment data card. Set the default to ThisItem.Attachments and Update to DataCardValue7.Attachment (here the datacardvalue7 is the project attachment control)

    5) Configuring the combined attachment control

    We come to the final step - there are many ways to manage this, reza is basically using this control only to display all the attachments, attachments cannot be added or removed

     

    Anonymous_Hippo_2-1706649906019.png

    For the combined attachment Datacard set the following values :-

    Default = ThisItem.Attachments

    Update = DataCardValue9.Attachments

     

    For the combined attachment control

    Items = colFinalAttachments

    Default = Blank

     

    That's it ! Hope this helps

     

    Cheers !

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 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard