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 / Attach multiple attach...
Power Apps
Answered

Attach multiple attachments from a gallery list to SP list

(0) ShareShare
ReportReport
Posted on by 30

Hi MVP's,

 

I need some help, I am building a solution where I have create a dynamic Gallery that I add line items, for each line item there is 2 or more attachments that i need to add, this is all collected in a collection, and from there I need to write it to a SP list, can someone help me please

Categories:
  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @JJ8810 ,

     

    It depends how you generate the collection that includes multiple attachments. In short words, the collection needs to include an Attachments field with columns as follows:

    vjefferni_0-1679551103004.png

     

    Best regards,

  • JJ8810 Profile Picture
    30 on at

    Hi Thanks for the respons, i actually managed to get it write after hours of online time and Youtube, below is the code i used and the link to the Video

     

    https://youtu.be/npvAQLZaG1c

    @ShaneYoung @RezaDorrani  not sure if they could make this better, but it did help me out alot.


    //Prepair Sub-Gallery Attachements to be uploaded to SP List
    Ungroup(
    ForAll(
    ListOfBiidersSelected.AllItems,
    ForAll(
    RFQDocumnt.AllItems,
    Collect(
    VImage1,
    {Value: ThisRecord.Value}
    );
    Collect(
    dataCollection,
    {
    Name: ThisRecord.Name,
    base64: With(
    {
    varDemoFromAttachmentControl: JSON(
    Image4.Image,
    JSONFormat.IncludeBinaryData
    )
    },
    Mid(
    varDemoFromAttachmentControl,
    Find(
    ",",
    varDemoFromAttachmentControl
    ) + 1,
    Len(varDemoFromAttachmentControl) - Find(
    ",",
    varDemoFromAttachmentControl
    ) - 1
    )
    )
    }
    )
    );
    //Patch Bidder Information
    Patch(
    'List_of_Bidders new test',
    Defaults('List_of_Bidders new test'),
    {
    Title: title,
    ReceivedFrom: ComboBox1.Selected.DisplayName,
    company: company,
    email: emails,
    BU: "BU" & Mid(
    title,
    4,
    3
    ),
    Discipline: discipline,
    DueDate: duedate,
    ServiceType: "Sub-Contractor",
    ProjectName: txtProjectName.Text,
    EDSNextProjectNumber: txtProjectNumber.Text
    }
    );
    Refresh('List_of_Bidders new test');
    //Create Collection for Flow Upload of attachments
    Collect(
    BigCollection,
    {
    ID: First(
    Sort(
    'List_of_Bidders new test',
    ID,
    SortOrder.Descending
    )
    ).ID,
    AttCollect: dataCollection
    }
    );
    'PowerApp->Compose'.Run(
    JSON(
    BigCollection,
    JSONFormat.IndentFour
    )
    );
    RemoveIf(
    BigCollection,
    true
    );
    RemoveIf(
    dataCollection,
    true
    )
    ),
    "Value"
    );

  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @JJ8810 ,

     

    So, you are using Power Automate to add attachments to a newly created item now, which is good and exactly the way we achieve that need. Nice work!

     

    Best regards,

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 258

#3
Mohsin Ali Profile Picture

Mohsin Ali 231

Last 30 days Overall leaderboard