Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Logic condition keeps returning false



The purpose of this flow is to create a Planner task from an Email with attachments.

The attachments are saved in a SharePoint folder. Links to the folder are included in the planner task:The general flowThe general flow


When I test this Flow with an E-mail with 2 attachments, it is completed. But the logic test however returns a false.



The result is that no attachments are saved and the planner task created does not have file-links.


This is the formula in the logic test: equals(body('Get_email')?['HasAttachment'], true)


Any ideas why this test is not working as intended and how I can fix it?
Thank you very much for your helpful advice!



Hi @NilsBruijel 


 I do not think it is the scope that is at error. So what is the apply to each doing in your flow? IN my flow, I have defined a scope and am checking if there are attachments and then apply to each attachment to do something: hshhs.PNG


Hope this Helps!


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!

Helper II
Helper II

What about creating an attachment array? Then if there's no attachments, the default is null.



After checking the has attachments option, you can put the attachment array in the yes branch if the condition is true or else leave the no branch as is.

@yashag2255 You are totally right. It does make more sense to apply the "for each" in the branch, after testing for their presence.

So far my flow is actually no longer failing the test! Now I'll go on to 1) save the files in SharePoint and 2) add links in the planner task created earlier.

Messing around with that now. Cheers, feeling optimistic I can solve this. 

Hey @NilsBruijel  Sure! Give those steps a try and reach out with your progress!!

Helpful resources

Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (3,441)