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 / How to send all the Sh...
Power Apps
Answered

How to send all the SharePoint list item attachments in an email using Power Apps

(0) ShareShare
ReportReport
Posted on by 2,057 Season of Giving Solutions 2025

I have this formula inside a submit button:-

 

//the file to be added asa list item attachment
Set(varAttachment, { DisplayName: Substitute("Print Job" & Text(Now(),"yyyy-mmm-dd hh:mmm AM/PM") & ".pdf", ":","_"), Id: Substitute("Print Job" & Text(Now(),"yyyy-mmm-dd hh:mmm AM/PM") & ".pdf",":","_"), Value: Substitute(JSON(varWorkOrderPDF,JSONFormat.IncludeBinaryData),"""","")});

IfError(
SubmitForm(PrintFormForm),
 Notify(
 "Error Submitting the Print form",NotificationType.Error,10000),

Office365Outlook.SendEmailV2(
 PrintFormForm.LastSubmit.'Printing House Email',
 PrintFormForm.LastSubmit.'Email Subject',
 PrintFormForm.LastSubmit.'Email Body',
 {
Attachments:Table({
 Name: varAttachment.DisplayName,
 ContentBytes: varAttachment.Value
})

 }
);

 );

 

the formula will generate a PDF >> then attach it to an email as attachment. now we need to expand this formula, to allow attaching all the list item attachments inside the email (and not just the generated PDF file), for example we have the generated PDF and 4 images.. how we can attach all the attachments inside the attachment control in the email?

 

johnjohnPter_0-1700422249875.png

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,454 Most Valuable Professional on at

    Hi @johnjohnPter ,

    I am a little unclear what you are doing with the file names here as your code does not seem to match the file names you have posted in the image, however assuming you simply want to change the time from hh:mm to hh_mm in existing files names, This would be much easier if you simply sent the files with the current names.

    IfError(
     SubmitForm(PrintFormForm),
     Notify(
     "Error Submitting the Print form",
     NotificationType.Error,
     10000
     ),
     With(
     {
     _Attach:
     ShowColumns(
     AddColumns(
     AttacmentControlName.Attachments,
     "NewName"
     "Print Job" & Text(Now(),"yyyy-mmm-dd hh_mmm AM/PM") & ".pdf"
     ),
     "Value",
     "NewName"
     )
     },
     Office365Outlook.SendEmailV2(
     PrintFormForm.LastSubmit.'Printing House Email',
     PrintFormForm.LastSubmit.'Email Subject',
     PrintFormForm.LastSubmit.'Email Body',
     {
     Attachments:
     AddColumns(
     RenameColumns(
     _Attach,
     "Value",
     "ContentBytes",
     "NewName",
     "Name"
     ),
     "@odata.type",
     ""
     )
     }
     )
    )

     

    Please click Accept as solution 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 Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • johnjohnPter Profile Picture
    2,057 Season of Giving Solutions 2025 on at

    @WarrenBelz currently inside the attachment control, we can upload any file such as the 4 images +the PDF ffile that get generated.. in short how we can attach all the attachments inside the attachment control (which can include already existing attachments and new attached not saved yet to sharepoint) inside an email? thanks

  • Verified answer
    WarrenBelz Profile Picture
    156,454 Most Valuable Professional on at

    @johnjohnPter ,

    Beyond what I have already posted, this blog of mine may also be of assistance.

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

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard