cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Flow Condition Not processing conditional logic correctly

Hello,

 

I have been working on a tough flow for the last few weeks. Here Is my latest issue: (I'll also post pictures of the flow below this article for ease)

Please also note I have a very basic understanding of flow code and logic, it is possible I've made a rookie mistake.

 

First, the flow collects items from a sharepoint list named: Users Contacted - It then takes that data and dumps it into a variable (UsersContacted)

Next, the flow collects items from a sharepoint list named: Form Completed - It then takes that data and dumps it into a variable. (FormCompleted)

For the next step, we have an apply to each, with a value input from the step where we pulled the sharepoint items from the Users Contacted list.

Next, still inside the apply to each I added a condition to check if the variable "FormComplete" contains the users e-mail. (From users contacted list.

Condition:

Yes- Apply to each with the respective value from "FormCompleted" and then send an e-mail to the user.

No - Create a sharepoint item in a new list, called Users Being Reminded. (To keep track of who the flow is currently set to remind)

 

My issue is this:

The first flow run always follows the logic and does exactly what I want, however...any subsequent attempts have unexpected outcomes, IE the user gets a reminder email even though they are in both the users contacted list and form completed list.

 

What am I missing? Please help me Flow-naughts!ReminderFlowHelp1.pngReminderFlowHelp2.png

16 REPLIES 16
ManishJain
Solution Sage
Solution Sage

Hi @Anonymous ,

 

You are basically trying to filter FormCompleted list by UserContacted  list. Do these list only contain email ? If no then your condition will not work. 

 

Inside apply to each use Filter Array action and input should be FormCompleted and then use the condition which have used.

 

Thanks

Anonymous
Not applicable

Hello @ManishJain 

 

I've tried this but still get the same result, could you post an example flow for me?

 

Thank you!

Hi @Anonymous ,

 

Can you please confirm what UserContacted and FormCompleted list comprises of ? Is it just holding emails of contacts?

 

For your reference to filter array do look at : 

 

https://sharepains.com/2018/12/18/microsoft-flow-filter-data-in-an-array/

 

 

Thanks

Anonymous
Not applicable

Sorry @ManishJain,

 

Yes, my SP Lists only contain one column name UserEmail1, UserEmail2, and UserEmail3 respectively. Of course, we know Flow won't show the title column name as anything other than "Title" so we may as well call that column Title.

 

I will take a look at your link, thank you!

Anonymous
Not applicable

 

@ManishJain

Here is my error after filtering the array:

Flowerror.png

Hi @Anonymous ,

 

Please use compose action prior to using a condition after filter array and provide your input like 

 

first(body('Filter_array'))

 

This will help you to understand whether you really need a loop after filtering.

 

Thanks

Anonymous
Not applicable

Hello,

 

I am still struggling with this Flow.

 

Maybe there is a way I could have the flow turn the 2 sharepoint lists into another form of data flow could better work with?

 

PLEASE HELP!

Hi @Anonymous ,

 

The error after filter array is happening so I would put a condition to check if filter array returned some data like this 

 

empty(body('Filter_array) is equal to true , if yes do nothing , else in no part do your logic.

 

Thanks

Anonymous
Not applicable

Thanks for that tip @ManishJain 

 

I've attached a new photo of the latest error:

ReminderFlowHelp3.png

Hi @Anonymous ,

 

Can you please share screenshot of error .

 

Thanks

Anonymous
Not applicable

Hey @ManishJain 

The error is that the condition is not functioning. The flow is still sending the "no" response whether the user email is in the FormCompleted list or not.

 

How can we tell it to process this correctly?

HI @Anonymous ,

 

After filter array if your condition is what I mentioned to check empty(body('Filter_array')) is equal to true then user has not been contacted , so you do your processing accordingly.

 

Where is your condition failing?

 

Thanks

Anonymous
Not applicable

@ManishJain 

 

This is my Flow, specifically the piece that seems to "skip" the condition 2, where it checks if the body of filter array is equal to true (Which should indicate it is empty?)

In my current case, it should come back false, because it has a value. But the flow continues with the "If no" side of the condition. (The proof of this is in the bottom image)

ReminderFlowHelp4.pngReminderFlowHelp5.png

In your condition2 you are checking body is equal to true which is wrong. You should check empty(body('Filter_array))  put this in expression and compare it to true . 

 

Thanks

Anonymous
Not applicable

@ManishJain 

Additionally, I verify that I've removed the user e-mail for the form completed list, to ensure the condition will receive an empty value...but it still says it is false. This should make it say true wouldn't it?

ReminderFlowHelp6.png

Hi @Anonymous ,

 

I tried your steps as it is and I am getting true , how are you are getting false I am not sure. Please check your expressions in condition and right side expression as well 

 

Capture.JPG

 

This is my flow during design

 

Capture.JPG

 

I used following expression in condition "empty(body('Filter_array_2'))" and true 

 

 

Thanks

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,194)