cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
adove
Level: Powered On

Send email with attached file from SharePoint library document

I am trying to send an email to a prescribed list of users. The trigger for my Flow is "when an item is created or modified" in a SharePoint Library. While I have been able to work out the sending of a LINK to the attachment positioned in the body of the email, what I am trying to accomplish is to attach the library item as an attachment on the email.

 

Please see my below screenshots of my flow:

 

Flow_Email_Attach_01.pngFlow_Email_Attach_02.png

 

All of the examples I found online reference an "identifier" object. 

When I attempted to add a new action "get file contents", I could never grab the "File Identifier" property to allow me to grab the "content" dynamic property of the library item to use in the email.

 

Has anyone been able to solve this issue?

Many thanks,

ADove

12 REPLIES 12
Dual Super User
Dual Super User

Re: Send email with attached file from SharePoint library document

Hi @adove , 

 

Please see the screenshots belowsplal.png

 

sjkhsjk.png

Note: Configure the array with the same attribute names. 

tetetete.png

Hope This Helps!

 

Thanks. 

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

v-zhos-msft
Level 10

Re: Send email with attached file from SharePoint library document

Hi @adove ,

I was confused about your scenario.

Where is the file stored, in the SharePoint library or as an attachment in the SharePoint list?

If the file is in the library, I suggest you use the trihgger 'When a file is created or modified (properties only)'.

Then you can get the "identifier" from the trigger.

If the file is in the list, you can take a reference of @yashag2255's flow.

Best Regards,

Community Support Team _ Zhongys

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

adove
Level: Powered On

Re: Send email with attached file from SharePoint library document

When I run my Flow based on your recommendations, I receive an error "Column attachments does not exist." I believe this is because I am working from a library and not a list. If so, do you have another fix for allowing me to grab the file from a library?

 

Thanks.

adove
Level: Powered On

Re: Send email with attached file from SharePoint library document

What are the series of actions to use if my file is in a SharePoint library?

Super User
Super User

Re: Send email with attached file from SharePoint library document

Hi  @adove ,

 

Use the Flow Step SharePoint Get File Content. It allows you to get the file content which you can map as your email attachment.

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

 

Thanks

 

 

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!



adove
Level: Powered On

Re: Send email with attached file from SharePoint library document

After adding the 'Get File Content' action and clicking the 'File Identifier' button I get what amounts to an error. Is there an expression that I need to use instead or someother way to get the 'File Identifier' to work correctly (see screenshot):

 

Flow_Get_File_Content.png

 

Not sure what to do next. Any ideas?

Dual Super User
Dual Super User

Re: Send email with attached file from SharePoint library document

@adove 

 

Please seee the screenshot below and replicate:spspa.PNG

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

adove
Level: Powered On

Re: Send email with attached file from SharePoint library document

I don't think you understand. I can't call the 'Identifier' object from the 'Get file content' action. When I click into the field and press on the folder I receive a pop-up message indicating that SharePoint can't evaluate to the parameter 'path.#.dataset' ... etc.

Super User
Super User

Re: Send email with attached file from SharePoint library document

Hi @adove ,

 

The error is related to flow cannot find the fields on the library as it doesn't know which library to look and bind for.

 

You could try this via flow step 'Send an HTTP request to SharePoint'.

 

Set the address as runtime parameter like you used now, method as Post and specify the Uri (Rest API).

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

 

Thanks

 

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!



Dual Super User
Dual Super User

Re: Send email with attached file from SharePoint library document

Hello @adove 

 

Please try using the action as shown in the screenshot for that. You should use the send an HTTP request only if the direct actions do not support waht automation you are trying to achieve. 

hhs.PNGHope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Super User
Super User

Re: Send email with attached file from SharePoint library document

Hi @adove ,

 

Any of these latest suggestions were helpful?

 

If you need further help please let me know.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!



adove
Level: Powered On

Re: Send email with attached file from SharePoint library document

No, none of the suggested solutions work. I continue to receive the above error when attempting to grab the identifier from either the 'File Path' using the 'Get file content using path' or the 'File Identifier' using the 'Get file content'. As to the suggestion that the flow doesn't know what library I am attaching to, that should have been clear from the trigger 'When a file is created or modified (properties only)' because it asks for the library name (which I input) and the associated folder (which I input as the root of the library).

Helpful resources

Announcements
firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

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!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors
Users online (5,912)