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 / Copy Sharepoint item a...
Power Automate
Unanswered

Copy Sharepoint item attachments as an attachment in the email

(0) ShareShare
ReportReport
Posted on by 10
 
Hello,
I have a flow that starts when an item is created in an online sharepoint list. The flow sends approval emails. I need to include the ITEM attachments as an attachment in the email. The link is not valid for permission issues. Any idea what control to use or how to do it?
Categories:
I have the same question (0)
  • Mirian Profile Picture
    10 on at

    I have managed to send the attachments each one in an email, but I need them to be all in the same email
    the steps :

    1. sharepoint-Obtain attachments
    2. Sharepoint-Get archive content. Here, an application is automatically created Aply to each and that is where I have sent the file by mailScreenshot_4.png

     Screenshot_5.png

     

     

     

     

    How I can send all the attachments in one email?

  • Verified answer
    v-xida-msft Profile Picture
    on at

    Hi @Mirian,

     

    I have made a test on my side and please take a try with the following workaround:

    • Add a "When an item is created" trigger.
    • Add a "Get attachments" action, specify Site Address and List Name. Id field set to ID dynamic content of the trigger.
    • Add a "Variables"-> Initialize variable action, Name set to AttachmentArray, Type set to Array and Value set to empty.
    • Add a "Apply to each" action, Input parameter set to output of "Get attachments" action.
    • Within "Apply to each", add a "Get attachment content" action, specify Site Address and List Name. Id field set to ID dynamic content of the trigger, File Identifier field set to Id dynamic content of "Get attachments" action.

             Add a "Append to array variable" action, Name choose AttachmentArray variable, Value set to following formula:12.JPG

           Within json format text, the key of first element set to Name and corresponding value set to DisplayName dynamic content of "Get attachments" action. The key of second element set to ContentBytes and corresponding value set to following formula:

    • body('Get_attachment_content')?['$content']
      Under the "Apply to each" action, add a "Send approval email" action, Attachments field set to AttachmentArray variable.

    Image reference:16.JPG

     

    13.JPG

    The flow works successfully as below:14.JPG

     

    15.JPG

     

    Best regards,

    Kris

  • Mirian Profile Picture
    10 on at

    Thank you so much!

    it is running now.

  • rovargas Profile Picture
    6 on at

    Hi Milan,

     

    Is this solution still working? I cna't seem to replicate it. I get the email from the flow but not files are attached to it. I followed the instruction to a T.

     

    Rod

  • Matthew_Gould Profile Picture
    2 on at

    My flow goes through with no errors but there is no attachment in the email, any ideas?

  • KelliWard Profile Picture
    7 on at

    I have been working with this for a couple of days and I can't get past this same error.  

     The template validation failed: 'The action(s) ''Get_Attachment_content' refferenced by 'inputs' in action "Append_to_array_variable_2' are not defined in the template.

    (I'd upload a screenshot, but it isn't allowing me to upload it here for some reason.)

     

    I think part of the reason is that some changes to Flow tempaltes have been made since this was written, but I can't figure out what to change to correct this error.  It's just outside of my Flows knowledge, so I was just trying to replicate what was created in this SOLUTION.  

     

    EDIT:  I FINALLY got it to work.  Dummy me, I needed to add _2 to part of the name.  BUT - Now the issue is that it doesn't attach the uploaded attachment to the initial email. It only attaches to the approved/rejected email.  Reason here is because there is no template for Send Approval Email for Outlook in Flows.  You have to start an approval with a condition attached to it of "if yes" and "if no". I can't get it to work with an approval email like what is shown above.

     

    Any chance anyone has some ideas?

     

    Thanks!

    Kelli

  • Nathanielyb Profile Picture
    2 on at

    So I feel like I got the entire this correct but in the "append to array variable" I have typed exactly what is in this thread and it says in red below "enter a valid json". any ideas what an amature like me is doing wrong?

     

  • SSegura96 Profile Picture
    4 on at

    @v-xida-msft  You don't have an idea of how much you help me thanks a lot !!!

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

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard