web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Flow to select and sen...
Power Automate
Unanswered

Flow to select and send onedrive file as an attachment in email

(0) ShareShare
ReportReport
Posted on by 146

Hello Experts!

 

Is it possible to get a specific file saved in OneDrive and send it as an attachment via email (based on an item from SP list)?

 

I have a first flow that creates a PDF letter and saves it in my OneDrive and I would like to create a second flow that runs and send an email to a specific person included in the SharePoint list with the PDF letter as an attachment.

 

I have a choice column in my SP List with the values "Sent", "Pending" and "To be sent". Once the column is marked as "To be sent" my second flow will run. The trigger is "When an item is created or modified". Now I am trying to find a way where I can select a specific letter from my OneDrive based on the item selected in the trigger and attach it in the email. 

I tried by saving the  "Id" generated when I created the PDF file from the first flow in the "Title" column from the SharePoint list in order to use this code in my second flow to know which letter to select, but it did not work.

 

I am using this approach because I noticed that after I saved a PDF in my SharePoint list "attachment", I got an error when opening (see image below). 

 

I really appreciate any guidance on how to create a rule to identify which PDF file to be selected from the OneDrive and attach it in the email. I was thinking of creating a rule that looks for a specific file name in the OneDrive but has not been able to achieve it. 🙂

Flow.JPG

Thank you in advance!

Categories:
I have the same question (0)
  • J_Porter Profile Picture
    on at
    Re: Flow to select and send onedrive file as an attachment in email

    Here,
    Try this:

    Make sure to set "Limit Columns by View" to "Use all columns (Do not limit)" in the When an item is created trigger.

    What I've done is selected a file in the SharePoint site location that stores the attachment and then replaced the two values defining row / 'ID' (from trigger) and 'Display Name' (from get attachments) this will look for the attachments dynamically as they are added to the list.
    This will give an error if you add an item with no attachment, so I suggest adding a control action to only process the get file content using path action if the 'has attachments' value is equal to the Boolean true.

    As shown below:

    J_Porter_4-1613110732625.png

    J_Porter_5-1613110802431.png

     

    Let me know if this helps.

     

     

     



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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard