Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Send Email with Multiple Attachments

(0) ShareShare
ReportReport
Posted on by

I built a flow that would get attachments from SharePoint and append to an Array to use to send multiple attachments.

I followed the set of instructions using this link https://flow.microsoft.com/en-us/blog/multiple-attachments-single-email/.

Now the flow is working, however, instead of sending one email, it seems to be sending an email per attachment, so if I have 3 attachments it will send 3 emails, and sometimes attaching the same documents 2 or 3 times in the same email.

Could you please tell me what I'm doing wrong?

 

Thank you!

 

 

11223344556677

  • 55552 Profile Picture
    667 on at
    Re: Send Email with Multiple Attachments

    I just tried this and it worked! Multiple attachments emailed in a single email!

  • Community Power Platform Member Profile Picture
    on at
    Re: Send Email with Multiple Attachments

    @Mani4656 
    It seems you might have the same issue discussed on this thread, where more than 1 Apply to Each are dependent one another. So you might want to decouple them.
    And I would suggest having a look at that link as well for multiple attachments in 1 e-mail:
    Advanced | Flow of the Week: Send multiple attachments on a single email | Power Automate Blog (microsoft.com)

    Hope this helps!

  • Mani4656 Profile Picture
    4 on at
    Re: Send Email with Multiple Attachments

    List 1.PNGList 2.PNGPA List 1.PNGGet Attach.PNGLevel 1 and 2.PNGGet attachments in PA.PNGGet content.PNGGet approver list.PNGVar approvers 1.PNGvar approvers 2.PNGStart and wait for approval.PNGEmail 1.PNGEmail 2.PNG

     

    The Data source i am using here is SharePoint, I have got 2 lists.
    From my List 1 records contains attachments. I am filtering the records with status as " Level 1 Approved - Pending Level 2 Approval " and look up with Department in List 2 and send workflow approval with Level 1 and Level 2 Approver.
    My flows start from Get items from SharePoint list 1 and List 2, The flow designed from my end is as,
    I am trying to run this flow. The apply to each attachment content from item 1 in list 1 attaches respective attached documents while its moving on to the next item 2 its fetching all the attachments from item 1 along with item 2 list 1 attachments for approval workflow in email. Can anyone help me on this please? Looking forward to hear back from you at the earliest.
    First email - Test 1 list record receives that contains only 2 attachments which is correct.
    First email - Test 2 list record contains only 2 attachments which is (genpact interview.txt and uipath excel code.txt) which should be on email. But i receive 4 attachments which is inclusive from first item in the loop which is incorrect.
    Need assistance.
    The List 1 items contains multiple attachments and also the attachments should reflect in teams for the approvers.
    Regards,
    Manikanta R




  • Mani4656 Profile Picture
    4 on at
    Re: Send Email with Multiple Attachments

    If we make the array empty than no attachments found in email. I am currently facing this issue. Could you please help me

  • jaina Profile Picture
    517 on at
    Re: Send Email with Multiple Attachments

    edit:

     

    Was able to figure this out! thanks


    -----------------------------------------------------------------------------------------
    Hi @Anonymous ,

     

    I have the same issue with multiple attachments and send an email actions.. 

     

    how did you manage it? I mean I tried to run the flow where in Send an Email action is outside "Apply for each" condition, but I encountered error says

     

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

  • efialttes Profile Picture
    14,756 on at
    Re: Send Email with Multiple Attachments
    HURRAY!
    IT WORKS!
    I've seen you marked this topic as solved. Thanks for your kindness!
    This way other community members facing this same problem in the future have the chance to find a solution faster.

    Thanx for your contribution to keep this community great!
  • Community Power Platform Member Profile Picture
    on at
    Re: Send Email with Multiple Attachments

    Thank you @efialttes and @v-litu-msft!

     

    I was able to make it work thanks to your suggestions. I had to add a few steps, but was at least able to get the Send e-mail out of all the "Apply to each" as per below:

     

     

    WorkingFlow1.PNG

     

     

     

    WorkingFlow2.PNG

  • Verified answer
    efialttes Profile Picture
    14,756 on at
    Re: Send Email with Multiple Attachments

    Hi!

     

     

    the 1st Apply to each is to save attachments from Forms to SharePoint using this model: 

    https://www.youtube.com/watch?v=IDW3ikTHu9U

     

    So, if the 'Send an email' is inside this 1st 'Apply to each' and you have 2 attachments, 1st Apply to Each will iterate 2 times, and you will send two emails instead of one

     

    2nd Apply to each I used was to be able to calculate a difference between 2 dates, following that model: https://powerusers.microsoft.com/t5/Building-Flows/Flow-to-calculate-elapsed-days-since-List-item-modified/td-p/182614

     


    Now, you have a 2nd Apply to Each inside the first Apply to Each. If 'Send an email' is inside this 2nd 'Apply to each' also, an assuming 2 attachments, you will not send 2 emails, but 2 multiplied by N emails, being N the number of iterations of 2nd 'Apply to each'

     

    If your goal is to send a single email, move 'Send an email' outside all these nested 'Apply to each'

    Hope this helps

     

     

  • Community Power Platform Member Profile Picture
    on at
    Re: Send Email with Multiple Attachments

    @efialttes @v-litu-msft  I am not sure the problem is "Apply to each"; it seems related to the number of attachments that are being loaded in SharePoint. Could it be a time lag and loading time issue? I just re-tested it, so if I attach only 1 file, I get 1 e-mail which is fine. If I attach 2 files, I get the 1st e-mail with 1 attachment, and a second e-mail with 2 attachments. Now if I attach 3 files, I get 1 e-mail with 1 attachment, the second with 2 attachments, and the third with 3 attachments. In addition I get the emails in the same order of the loaded attachments; i.e. the first attachment loaded is coming first, then the first and second, then first second and third, etc.

     

    Do you still think it's an  "Apply to each" issue?

     

    Thanks!

  • Community Power Platform Member Profile Picture
    on at
    Re: Send Email with Multiple Attachments

    @efialttes Actually the "Send an email" item is outside of "Apply to each 4" as can be seen below.

    It is just so it collects all the attachments and stores it in the array. Do you think I should remove it nevertheless? I don't think it should affect the number of emails sent though, would it?

     

     

    Flow8.PNG

     

    Thank you!

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

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,679 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow