Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Has Attachment - email

(0) ShareShare
ReportReport
Posted on by 158

I built a flow that watches an Outlook mailbox for emails. Any email that has an attachment has the attachment saved in a folder. Any email that doesn't have an attachment has the message body saved in a file in a different folder. The part of the flow that saves the attachments works perfectly. The part of the flow that saves the message body never works. This is what the condition block looks like

sammary_0-1715713193208.png

In other words, the Has Attachment never returns a False. I have tried testing the length of the attachment and using the Boolean function ('True' and 'False) with the same results. Some of the comments in these blogs seem to indicate that Has Attachment maybe "broken" and CoPilot seems to "think" that it isn't really looking at the attachment.

 

Does anyone have any thoughts on how to resolve my issue?

 

Thanks

Sam

  • Verified answer
    sammary Profile Picture
    158 on at
    Re: Has Attachment - email

    I'm happy to say that I have finally finished this flow. Both sides of the condition statement now create files in the specified folder.

    Thank you to everyone who supported me during the process of writing my first flow.

  • sammary Profile Picture
    158 on at
    Re: Has Attachment - email

    Has anyone downloaded an email body and is willing to share the flow or help me debug the flow that I have?

    Thanks

  • sammary Profile Picture
    158 on at
    Re: Has Attachment - email

    Well, I’m finally down with my other projects and I’m back to trying to get my Power Automate flow to work. The good news is that the emails that come in with attachments portion appears to be working fine, meaning attachments are downloaded. All that remains is to get the emails without attachments to download. Here is what I’m working with, if anyone has any ideas please share them.

     

    sammary_0-1718713940157.png

     

    sammary_1-1718713940161.png

     

    sammary_2-1718713940162.png

     

  • sammary Profile Picture
    158 on at
    Re: Has Attachment - email

    Things get more interesting the more I play with this flow. I sent an email to the shared mailbox this morning and the attachment downloaded fine. It took about 3 minutes from the time the email landed in the mailbox till it was downloaded, this was at about 0320 this morning. And I just had another success at 0817. Could this be a timing issue when the system is busy?

     

    The portion of my flow that attempts to download an email with no attachment is failing. The condition that is looking for an attachment is failing when the action should be and is false.

    sammary_2-1717680116750.png

     

    sammary_0-1717680037445.png

    sammary_3-1717680148408.png

     

     

     

    sammary_1-1717680071375.png

    Not sure why the downloads are suddenly successful but I am not going to fool with that portion of the flow again ;-}

  • Nived_Nambiar Profile Picture
    17,786 Super User 2025 Season 1 on at
    Re: Has Attachment - email

    Hi @sammary 

     

    I am confused as sharepoint action has executed succesfully- not sure why still u are able to see the file at that location even after checking after sometime ?

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel
    Blog: Nived Nambiar's Blogs

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

     

  • sammary Profile Picture
    158 on at
    Re: Has Attachment - email

    And my last email today.

    I added the Condition to the working flow, the one that saves attachments. As expected teh condition was true and the Yes portion executed but no file was downloaded.

    sammary_0-1717614570349.png

    Note that the next attachment shows that the file was created

    sammary_1-1717614630195.png

    Not sure what else to try????

     

  • sammary Profile Picture
    158 on at
    Re: Has Attachment - email

    Just did another test. I recreated the flow so that it just captures attachments, and it worked perfectly. I then took this recreated attachment portion of the flow and recreated it in the flow with the filter. 

     

    I sent an email with an attachment and this is what the flow looks like

    From

    sammary_0-1717611577587.png

    Body

    sammary_1-1717611612998.png

     

    sammary_2-1717611644124.png

    I would expect the inline to be false as this was just a basic email with an attachment, no graphics.

    Next I sent an email with an attachment and an inline graphics. The flow indicates that it worked but nothing was deposited into the folder (attachment or no attachment). I know the filter From and Body "see" the attachment because I see the attachment name in the raw dumps. The condition is showing false and that it used time, past that nothing in either of my download folders.

     

     

    e filter indicates inputs are false

  • sammary Profile Picture
    158 on at
    Re: Has Attachment - email

    Nived,

    I just started to look through the history of the latest "successful" flow and found something interesting. I downloaded the output from the box I have labeled "Process Emails for Drop" and I see the latest email. The body of the email looks like what I would expect an ASCII dump of a PDF file. In fact I searched for and found information that is in the email. For example the Customer ID 028-50922-1300

    sammary_0-1717607924835.png

     

    So at least we know that portion of the flow works. Next I went to the Filter Array box and I'm not sure what I see but it looks like either the first box is not passing the data or the filter is blocking everything.

    sammary_1-1717608031505.png

    The following are screenshots of the raw outputs from the filter

    Inputs

    sammary_2-1717608179703.png

    Outputs

    sammary_3-1717608236641.png

    In looking at the filter this is what I see

    sammary_4-1717608406702.png

    Which makes no sense to me why the From field would be the Attachment. And there are no other options under Dynamic Content. 

     

  • sammary Profile Picture
    158 on at
    Re: Has Attachment - email

    The word documents I sent show all the code in the flow. Neither side is saving the file and the history of the run is showing success only the flow is not taking any time to operate, everything is 0 seconds

    sammary_0-1717523910589.png

    sammary_1-1717523938007.png

     

    There is nothing confidential in the flow, is there a way I can send it to you?

     

     

     

  • Nived_Nambiar Profile Picture
    17,786 Super User 2025 Season 1 on at
    Re: Has Attachment - email

    Hi @sammary 

     

    I just need to see flow run so that i could check whether it got failed, i meant which action ?

     

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel
    Blog: Nived Nambiar's Blogs

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. 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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492