cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
victornabreu
Level: Power Up

Send E-mail with specific PDF file attachment stored in OneDrive using Excel and Outlook

Hi!

 

I have the following automation process through a third party software that I was hoping I could make it work with flow:

 

I have an Excel spreadsheet in which I input a File Name, an E-mail, a Subject and a Message. The File is PDF and stored in a specific OneDrive folder.

I have the software read the spreadsheet and send e-mails using Outlook - it reads the first line, starts a new message, populates the e-mail using the information from the lines "E-mail", "Subject" and "Message" and find the File in OneDrive (always the same folder) to send as an attachment.

 

When I was trying to build a flow, I could not get past the first part - I was able to have Microsoft Flow send the e-mail, populating the fields with the spreadsheet information quite easily, but I do not seem to be able to add the PDF attachment to each specific message. Is there a way to do this?

It is a different PDF for each message (which has a different e-mail address as well - all coming from the excel spreadsheet)

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Send E-mail with specific PDF file attachment stored in OneDrive using Excel and Outlook

 

Hi @victornabreu ,

 

If you can get the name of the file, then you can get the file content and send it as an attachment.

  • Use List files in folder to get the files contained in the specified folder.
  • Then filter out the specified file by the file name, and then get the file content.
  • Finally, send it as an attachment.

Image reference:

194.PNG195.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Community Support Team
Community Support Team

Re: Send E-mail with specific PDF file attachment stored in OneDrive using Excel and Outlook

 

Hi @victornabreu ,

 

Could you share a screenshot of your currently configured Flow?

 

It seems you want to get the filename of the PDF and email address from the Excel table.

 

I'm afraid I don't quite understand what the first part you mentioned is. Please provide more details.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
victornabreu
Level: Power Up

Re: Send E-mail with specific PDF file attachment stored in OneDrive using Excel and Outlook

Hello, thank you for the response!

 

Yes, I want to get the file name from the Excel spreadsheet and have Microsoft Power Automate search for this file name within a designated OneDrive folder and attach this file to an Outlook message - which will be populated using other info from the same row in excel (e-mail, subject and message).

 

I tried building a flow, but ended up deleting it. 

It went like this: button activated - get rows - for each row, send e-mail - use the info from the row and send. 

But I wasn't able to attach a file. Actually, I don't know if it's possible or not, that's what I'm trying to figure out - how to attach a specific file (FileName.pdf from the Excel Spreadsheet). 

Community Support Team
Community Support Team

Re: Send E-mail with specific PDF file attachment stored in OneDrive using Excel and Outlook

 

Hi @victornabreu ,

 

If you can get the name of the file, then you can get the file content and send it as an attachment.

  • Use List files in folder to get the files contained in the specified folder.
  • Then filter out the specified file by the file name, and then get the file content.
  • Finally, send it as an attachment.

Image reference:

194.PNG195.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

victornabreu
Level: Power Up

Re: Send E-mail with specific PDF file attachment stored in OneDrive using Excel and Outlook

It took some adjusting, since the FileName comes from a Row in excel - and Microsoft Flow tends to create a "apply for each" since it comes from an array. So there are two lists, one list of files and one list of excel rows.

 

But your suggestion worked, @v-bacao-msft .

I will leave a print of the final flow 

 

image.png

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons in April

Read the announcement for more information!

firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (6,860)