Skip to main content

Notifications

Power Automate - General Discussion
Unanswered

Multiple optional attchments to email

(1) ShareShare
ReportReport
Posted on by 14

Hi!

I have a flow in which I analize separately the content of 4 excel files, and keep only those who have data.

The idea is to send an email only with files having content (not empty)

So, I managed to do that, but in the end, when i compose the send email part, I need to stablish the 4 files, and when some of the files are empty, the flow fails.

 

What I need is the versatility of the email being send with 0 , 1 , 2 , 3 or 4 files, according to the content

ny idea?

  • AndreaMeras Profile Picture
    AndreaMeras 14 on at
    Re: Multiple optional attchments to email

    Hi Manuel,

    I tried already but that didnt solve the issue. I still receive an empty email. I tried the conditions separately and it works, (without the need for the array) but when I have them all together they fail

  • manuelstgomes Profile Picture
    manuelstgomes 6,625 on at
    Re: Multiple optional attchments to email

    Hi @AndreaMeras 

     

    I need to change the article in one print screen. The "ContentBytes" should be like this:

    "ContentBytes": <base64>
    
    and not 
    
    "ContentBytes": "<base64>"

     

    The issue could be the double quotes!

     

    Cheers
    Manuel

    ------------------------------------------------------------------
    If I have answered your question, please mark it as "Accept as Solution." It will help other members find the solution faster. If you like my response, please give it a Thumbs Up. ?
    Otherwise, reply to it, and the community will do its best to help you.

  • AndreaMeras Profile Picture
    AndreaMeras 14 on at
    Re: Multiple optional attchments to email

    Thanks Manuel! I tried and the flow doesnt fail but I receive an empty mail (no attachments). I will have to see what Im doing wrong with the array. 

    AndreaMeras_1-1660070743557.png

     

     

     

  • manuelstgomes Profile Picture
    manuelstgomes 6,625 on at
    Re: Multiple optional attchments to email

    HI @AndreaMeras 

     

    It's possible. You can build the "array" of attachments along the way and when you send the email, provide that array as the attachments parameter.

    Here's an article on how to add attachments dynamically to an email

     

    Is this what you need?

     

    Cheers
    Manuel

    ------------------------------------------------------------------
    If I have answered your question, please mark it as "Accept as Solution." It will help other members find the solution faster. If you like my response, please give it a Thumbs Up. ?
    Otherwise, reply to it, and the community will do its best to help 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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,666

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,996

Leaderboard