web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Flow doesn't work when...
Power Automate
Answered

Flow doesn't work when attachment not present

(0) ShareShare
ReportReport
Posted on by 30

Hi, 

 

I created a simple flow where users can attach files (if applicable). When i run the process WITH attachments, everything works fine, but when I run it WITHOUT attachments it fails. 

 

 Screenshot_1.pngScreenshot_2.png

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    69,024 Most Valuable Professional on at

    You need to put a condition in front of the Add Attachment action to see whether a file was supplied when the Flow kicked off.  If it wasn't then go around the add attachment.

  • P00118510 Profile Picture
    30 on at

    Hi, 

     

    i originally had the process without the condition statement and was working fine. I dont know what happened overnight but it stopped working today.

     

    Any other ideas ?!!?

     

    thank you for your response

  • Pstork1 Profile Picture
    69,024 Most Valuable Professional on at

    The point is that if you don't supply file content when you trigger the Flow, but still try to create an attachment it is going to give you an error because you are trying to create a file without content.

  • P00118510 Profile Picture
    30 on at

    Hi, 

     

    so i added a condition as per your suggestion but now it seems like the problem went to another part of the process. 

    My first step "manually trigger a flow" properly recognizes that there's an attachment added. But my 2nd step "Create an item" doesnt recognize the attachment. it says "has attachment-->false", thus my 3rd step which is the if condition doesnt kick in properly.

     

    1.png2.png3.png4.png5.png 

  • Verified answer
    Jay-Encodian Profile Picture
    2,920 on at

    Hi @P00118510 

    You need to change the condition expression to the following: contains(triggerBody(),'file')

     

    1.png

     This will check the trigger actions for the presence of a file...

    Example flow, when a file is not provided:

    1.png

     

    And when a file is provided:

    1.png

     

    HTH

    Jay

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

     

  • P00118510 Profile Picture
    30 on at

    Thank you Jay, it worked like a charm. 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 250 Super User 2026 Season 1

#2
Expiscornovus Profile Picture

Expiscornovus 222 Most Valuable Professional

#3
Haque Profile Picture

Haque 174

Last 30 days Overall leaderboard