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 / Send all files as atta...
Power Automate
Answered

Send all files as attachment by email from a Share Point Document Library Folder

(0) ShareShare
ReportReport
Posted on by 2

Greetings

 

Have been trying this for a time now. 

 

I need to tell flows to get all the files in my selected SharePoint Library folder and add them as attachments to an email.

I tried Get File Items and it works but it would sent an email for each file withing the selected SharePoint Library folder. I need to send just one email with all the files as attachments found in the selected SharePoint Library Folder.

 

Any help would be greatly appreciated

Categories:
I have the same question (0)
  • Verified answer
    v-yuazh-msft Profile Picture
    on at

    Hi @jaysomrivera,

     

    I have made a test on my side, please refer to screenshot below to create the flow:

    Capture.PNG

     

    Capture.PNG

     

    The expression in the Condition as below:

    @equals(items('Apply_to_each')?['{IsFolder}'], false)

    The expression of ContentBytes as below:

    body('Get_file_content')?['$Content']

    The flow would run successfully as below:

    Capture.PNG

     

    The email would be sent with attachment as below:

    Capture.PNG

    You could also refer to link below to learn send an email with multiple attachments:

    https://preview.flow.microsoft.com/en-us/blog/multiple-attachments-single-email/

     

    Best regards,

    Alice

  • Ludwig Reinhard Profile Picture
    on at

    Hi, 

    When I try to replicate this, I receive the error:

    InvalidTemplate. Unable to process template language expressions in action 'Append_to_array_variable' inputs at line '1' and column '2015': 'The template language expression 'body('Get_file_content')?['$Content']' cannot be evaluated because property '$Content' cannot be selected. Property selection is not supported on values of type 'String'. Please see https://aka.ms/logicexpressions for usage details.'.

    Is there any solution for this?

    Best regards,

    Ludwig

  • Nango Profile Picture
    2 on at

     Hi!

    here it is the solution!

    You have to modify 

    body('Get_file_content')?['$Content']

    to this:

    "ContentBytes": "@{base64(body('Get_file_content'))}"
    It is important to put body('Get_file_content') into base64 function.
    2019-11-28_16-52-22.pngKépkivágás.PNG
     

     

  • Community Power Platform Member Profile Picture
    on at

    Hi @v-yuazh-msft .

    Thank you you very much for you solution, my flow someway is very similar to this one here but I followed all the steps and I just keep getting one email per attachment, is very confusing for me because I'm not getting any error running the flow. Very appreciatte if someone could help me with this

     

    ..

     

  • susilacherla12 Profile Picture
    39 on at

    For me, its not working for attachments which are pdf files. I get the error 

    susilacherla12_0-1607622480200.png

     

  • susilacherla12 Profile Picture
    39 on at

    I rewrote the flow and with below it worked 

     

    susilacherla12_0-1607693423744.png

     

  • CU07110930-0 Profile Picture
    104 on at

    Hi this looks like a great option, I managed to recreate the flow and it works sending the email with the attachcments (PDF files) but for some reason when i try to open the files it gives me an error message that it cannot open the file "because it is either not a supported file type or because the file has been damaged"

    any thoughts on how to solve this please?

     

    thank you

  • susilacherla12 Profile Picture
    39 on at

    Yes, I faced a similar issue when I began.  Can you share your flow and I will compare with mine. You can hide the sensitive and confidential data

  • CU07110930-0 Profile Picture
    104 on at

    Thank you for getting back to me!

    For some reason beyond my understanding (i am super new to this) i write it again and it worked! i must have missed something before.

    I did another flow similar to it, but to send me the links instead of the files, and it also works, the problem is that it is sending all the links together (separated by comma) and i would like to have them all in separate rows and not a clue how to do that. Any thoughts

    Screenshot - Link flow.png

  • ClaireAllen Profile Picture
    762 on at

    @v-yuazh-msft ,
    Thank you for your solution, I have been able to replicate this workflow 🙂


    Regards

    Claire

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

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard