Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

Condition to verify valid email address in MS Form does not work

(0) ShareShare
ReportReport
Posted on by

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:

andybdiver_0-1597334239509.png

 

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.
Flow.jpg
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!

  • Random1232 Profile Picture
    32 on at
    Re: Condition to verify valid email address in MS Form does not work

    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

    Random1232_0-1670450841839.png

     

    expression is: 

    length(outputs('Search_for_users_(V2)')?['body/value'])
     

    Hope it helps!

  • JohnAageAnderse Profile Picture
    1,986 on at
    Re: Condition to verify valid email address in MS Form does not work

    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

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow