Skip to main content

Notifications

Community site session details
Power Automate - Building Flows
Answered

How to Use Power Automate to Send Emails from Excel with Multiple Attachments

Like (1) ShareShare
ReportReport
Posted on 6 Oct 2024 01:45:05 by 13
Hi All, i have tried to follow this video (https://www.youtube.com/watch?v=ku0NM9jhp-A&t=16s) guide to use power automate to send emails from excel with personal attachments. Now, i am trying to figure out how can i send multiple attachment. Can someone shed some light as I have been trying for days but with no success?
 
My excel contains the file name (without extention). Below is an example of the excel data in a single row.
I have split the DN Number by delimiter to new columns (up to All DN File Index 10 in case there are more DN in a sale order document)
 
 
This is the pdf in my One Drive which i would like to attach to my email. It should attached 0080701929 and 0080701930 only.
 
My flow begins with a trigger [For a selected row]:  when I select the row in excel and run the flow.
Then the next step is to [List files in folder]: this is the folder where I kept my attachments

The next step in the flow, I used the control [Apply to each] and added a [condition] to check the 'All DN File Index 1' matches with the file name (without extention) in my one drive. 
I was able to pull one attachment under 'All DN File Index 1' - 0080701929
The problem begins when I tried to add extra conditions for 'All DN File Index 2' to ' 'All DN File Index 10'.
Do I need to use variable array to capture the dynamic attachment? How do i do that and how can i add a condition to check all the attachments names are matching?
My flow ends with sending email with attachments if the condition is ok
  • Suggested answer
    noobiesaurus Profile Picture
    13 on 07 Oct 2024 at 05:02:09
    How to Use Power Automate to Send Emails from Excel with Multiple Attachments
    Hi All,
     
    I managed to find the solution through trial and error and would like to share the solution here.
     
    Overview of the flow:
     
    Apply to each condition:
     
    If Condition is met then Append to Array variable
     
  • noobiesaurus Profile Picture
    13 on 07 Oct 2024 at 01:47:11
    How to Use Power Automate to Send Emails from Excel with Multiple Attachments
    Thank you @FLMike for your reply and sharing the article. I am trying to add both dynamic attachments to the same email.
    However, the solution is grabbing all the attachments I have saved in the folder instead of filtering only file name 0080701929 and 0080701930.

    I am not sure if my filter array is input wrongly? I also tried to set a condition but it did not work.
     
     
    Zooming in to my Filter array, I tried to filter my dynamic column "All DN File Index 1" is equal to "Name without extention"
    I do have more dynamic column to check but after adding "All DN File Index 2" or "All DN File Index 3", the flow does not work.
    Without the filter array or condition, the email is just grabbing all the attachments in the folder.
     
    Overview of the flow now:
     
  • Verified answer
    Michael E. Gernaey Profile Picture
    41,580 Super User 2025 Season 1 on 06 Oct 2024 at 07:02:49
    How to Use Power Automate to Send Emails from Excel with Multiple Attachments
    Hi,
     
    So are you trying to add both attachments to the same email correct?. Here is a great sample of what you want
     
    And some more below just to provide other thoughts.
     
    Then what you really need is to do a couple possible things.
     
    1) use a filter array action and in the filter array, you can create a custom fielder where its an Or so like
     
    @or(equals(item()['FileName'], 'somevalue'), equals(item()['FileName'], 'somevalue'))
     
    And this would pull out only the items (and this is just a pseudo write up fyi) that have the 2 names you want.
     
    The reason for this is your send email should NOT be in your Apply to each that you use to grab the Attachment data
     
    2) have an array variable that you create, that for each Attachment, you collect the filename and the contentbytes
     
     
     

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!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,743 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,079 Most Valuable Professional

Leaderboard
Loading started
Loading started