Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

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?
  • SSegura96 Profile Picture
    4 on at
    Re: Copy SharePoint item attachments as an attachment in the email

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

  • Nathanielyb Profile Picture
    2 on at
    Re: Copy Sharepoint item attachments as an attachment in the email

    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?

     

  • KelliWard Profile Picture
    7 on at
    Re: Copy Sharepoint item attachments as an attachment in the email

    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

  • Matthew_Gould Profile Picture
    2 on at
    Re: Copy Sharepoint item attachments as an attachment in the email

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

  • rovargas Profile Picture
    6 on at
    Re: Copy Sharepoint item attachments as an attachment in the email

    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

  • Mirian Profile Picture
    10 on at
    Re: Copy Sharepoint item attachments as an attachment in the email

    Thank you so much!

    it is running now.

  • Verified answer
    v-xida-msft Profile Picture
    on at
    Re: Copy Sharepoint item attachments as an attachment in the email

    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
    Re: Copy Sharepoint item attachments as an attachment in the email

    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?

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow