cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
P00118510
Level: Powered On

Flow doesn't work when attachment not present

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

1 ACCEPTED SOLUTION

Accepted Solutions
Jay-Encodian
Level 10

Re: Flow doesn't work when attachment not present

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!

 

View solution in original post

6 REPLIES 6
Dual Super User
Dual Super User

Re: Flow doesn't work when attachment not present

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.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
P00118510
Level: Powered On

Re: Flow doesn't work when attachment not present

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

Highlighted
Dual Super User
Dual Super User

Re: Flow doesn't work when attachment not present

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.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
P00118510
Level: Powered On

Re: Flow doesn't work when attachment not present

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 

Jay-Encodian
Level 10

Re: Flow doesn't work when attachment not present

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!

 

View solution in original post

P00118510
Level: Powered On

Re: Flow doesn't work when attachment not present

Thank you Jay, it worked like a charm. 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,893)