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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / For a Selected File se...
Power Automate
Unanswered

For a Selected File send email to Email Column and Attach File

(0) ShareShare
ReportReport
Posted on by 14

I'm trying to create the following flow - for a selected file in SharePoint, send an email to the email in the Contact column, and attach the file for their reference. 

For context, I'd like to send an expiring insurance certificate to the insured (Contact) to request an updated one. I have hundreds of insurance certificates so this would allow me to sort by ones expiring soon and send emails for specific ones that need to be renewed.

I'm getting stuck in a few places.

Where do I tell the flow to use the email in the "Contact" Column?

How do I attach the file as an attachment?

"Send an Email (V2)" keeps getting put into an "Apply to each" and it causes the flow to happen to each file not just the selected one.

 

I've attached screenshots of my current flow, the columns in my doc lib, and the Apply to Each error I'm getting. Any screenshots back would be very helpful!

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    1) The first problem I see is you are using Get Files Properties only, which will retrieve an array of files.  What you want is Get File Properties and give it the File Identifier from the trigger.  That will retrieve just one file.  That's why you are getting the apply to each.

    2) Once you have the Get File Properties in place you should have some dynamic content called "Contact Email" or something like that.  YOu put that in the To field of the Send an email

  • LASA Profile Picture
    14 on at

    Thank you, that solved my issue with the Apply to Each!

     

    So now my remaining issue is getting the file to attach to the email. I believe I have to add a "Get file content" but this keeps braking the flow. Can I have a Get file properties and a "get file content" in the flow?? Without the "get file content" I cant add "File content" to the Compose.

     

  • Verified answer
    Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    After you do the Get file properties you'll need a Get file content using the same File Identifier.  Then you can add the filename with extension and the content in the advanced properties of the email.

    image.png

  • LASA Profile Picture
    14 on at

    There are two "ID"s available in Dynamic content, one for "For a Selected File" and one for "Get file properties" but either one I use causes an error with "Get file content" when I run the flow... 

    "File not found
    clientRequestId: 6e45f5c2-a6bc-48c9-b924-266c44dd8167
    serviceRequestId: 6e45f5c2-a6bc-48c9-b924-266c44dd8167" 

  • Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    There is an ID which is the List Item ID.  and an ID that is the File Identifier.  Use the File Identifier ID from the for a selected file Trigger.

  • LASA Profile Picture
    14 on at

    I am still have the File Not Found error and I cannot figure out why.

  • LASA Profile Picture
    14 on at

    I am still getting the File Not Found error and I cannot figure out why.

  • Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    The run shows a file identifier of 8.  That would be the list ID, not the file Identifier.  The file identifier should be a path value.  Double check again that you are using the one labeled as the file identifier from the for a selected file trigger.

  • LASA Profile Picture
    14 on at

    I had definitely used the "ID" labeled as the file identifier for a selected file, but that wasn't working. A little extra research led me to try this "Identifier" (value that can be used in file related actions for selecting...) and that worked!

    I did use "File Content" for the email Attachment Content and that still worked.

    Thank you for your help!!

  • Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    Identifier is the one in the Get File Properties.  The same value in the Trigger is labeled as File Identifier.

    image.png

    Either will work.  The other ID is from the Get File Properties and it won't work.

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 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard