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 / Send an email with an ...
Power Apps
Answered

Send an email with an attachment saved on SharePoint

(0) ShareShare
ReportReport
Posted on by 23

All,

There are a number of other questions similar to this out there and I have read through a couple dozen trying to achieve my goal.

In my app I have a section with generated emails that are sent out requesting quotes from vendors.
I would like to have the BoM attached to the emails as they are sent out.

Each of the BoMs live on our SharePoint site and will always have the same name so the location/file name can be hard coded.
My email form is based on the default email template.

Any assistance would be appreciated.

 

/*Create semicolon separated list of people to email, send the email, reset subject & message fields*/ 
Set(
 _emailRecipientString,
 Concat(
 MyPeople,
 Mail & ";"
 )
);
Office365Outlook.SendEmail(
 _emailRecipientString,
 vSANIGNetworkEmailSubjectTextEmailSubject_1.Text,
 vSANIGNetworkEmailBodyTextEmailMessage_1.Text,
 {Importance: "Normal"}
);
Reset(vSANIGNetworkEmailSubjectTextEmailSubject_1);
Reset(vSANIGNetworkEmailBodyTextEmailMessage_1);
Clear(MyPeople)

 

 I understand that I would need to use the following formatting;

 

Office365.SendEmail(inputTo.Text, inputSubject.Text, inputBody.Text, {Attachments:Table({Name:"file1.jpg", ContentBytes:Camera1.Photo, '@odata.type':""})})

 

 What I don't understand is how do I point to a specific location within SharePoint for the attachment.

I assume it has something to do with {Name:"file1.jpg", ContentBytes:Camera1.Photo, '@odata.type':""} however I have no clue how to make this work.

Thank you in advance.

Categories:
  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Titortian ,

    Where do you store your BoM files? SP Library or attached as attachments of SP List Item?

     

    If these BoM files stored in your SP Library, and you want to attached them within the email body in your app, I afraid that there is no way to achieve your needs in PowerApps currently.

     

    Currently, within PowerApps, there is no way or functions supported to get the file content of the files stored in a SP Library. As an alternative solution, I think the combination of PowerApps and MS Flow could achieve your needs.

     

    On your side, you could consider fire a flow from your app, then pass the _emailRecipientString value, vSANIGNetworkEmailSubjectTextEmailSubject_1.Text value, ... to the flow. Then within your flow, send an email based on the passed parameter values from your app. Within your flow, you could consider add a "Get file content" action of SharePoint connector to get file content of the specific BoM file from your SP Library.

    I have made a test on my side, please consider take a try with the following workaround:

    Flow's configuration as below:

    8.JPG

     

     

    App's configuration:

    9.JPG

     

    More details about firing a flow from an app, please refer to the following article or video:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/using-logic-flows

    https://www.youtube.com/watch?v=1wl9AtxWdkg

     

    If you want to send multiple files using single one email sent from flow, please check the following thread:

    https://powerusers.microsoft.com/t5/General-Power-Automate/Send-all-files-as-attachment-by-email-from-a-Share-Point/m-p/369453

     

    Please take a try with above alternative solution, then check if the issue is solved.

     

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

#2
Mohsin Ali Profile Picture

Mohsin Ali 340

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard