I have users submit a form that triggers a flow to create an item in a SharePoint List. The form includes a question to add the Managers email address. A condition checks if the email address is valid by searching for an active account. If Yes I want it to create the item and email the Manager to confirm it has been added. If the email is incorrect or does not refer to an active account, it should take the No route and send an email to the Form Responders' email to notify them an invalid email was entered. The flow looks like this:
I first tried this with just the first row of the condition set to Account Enabled is equal to true. When the form is submitted with the email of a valid account the value in the output of Search for users is set to true and the flow takes the Yes route and creates the item in SharePoint. However, if there is no valid account the output value is set to [0] and should, in theory, take the No route. Run history still shows the flow run as successful but the condition is "greyed" out and no email is sent to notify the form responder that the email entered is incorrect.
I added an extra row to take the Yes route if the output value did not equal [0] and got the same result. I also tried it with just the value is not equal to [0], and another attempt with the expression empty(body('Search_for_users')) equals false. Everything I have tried gives me the same result: a valid email takes the Yes route and invalid greys out the condition but run history says the flow ran successfully.
I would really appreciate some help with this. Thanks!
Been 2 years since question is asked but writing it down for anyone who comes here for answer:
In condition, instead checking Value is not equal '[0]', check for length(Value) is greater than 0
expression is:
Hope it helps!
Hello @andybdiver
Did you find a solution or is your issue still relevant?
There are three conditions that your flow needs to take into account when checking the email.
1) The email address is not found
2) The email address is found and active
3) The email address is found and not active
4) The email address search returns more than one result
The 1) result you have to test for before you enters the Apply to each action.
The 4) result you have to test for before you enters the Apply to each action.
The 2) and 3) you have to test for inside the Apply to each action, when the 4) result is only one!
Anyway, tell us where you are with this 🙂
Kind regards, John
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional