web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Check if email is valid
Power Automate
Unanswered

Check if email is valid

(0) ShareShare
ReportReport
Posted on by

https://powerusers.microsoft.com/t5/Building-Flows/Need-to-check-if-the-email-information-is-valid/m-p/1000888#M136554

 

This answer looks to be the simplest least over the top solution.

 

I'm having a difficult time figuring out what they're doing to validate the email, if its simply just creating a flow operation to query the email address text field against the MS User results or what...

 

Would someone be willing to hold my hand? I need a little extra help...

 

tl;dr: I need to check if my user entered a valid email or not. My flow won't work without a valid email.

Categories:
I have the same question (0)
  • PrasadAthalye Profile Picture
    on at

    You can implement expression to validate email address and if its not valid terminate... Below is an example when I was validating email from forms output

     

    contains(last(split(body('Get_response_details')?['r9f2ae5d6c71c4cdc88fcf52ebc7d86ed'],'@')),'.')

      

  • Community Power Platform Member Profile Picture
    on at

    Hey Prasad,

     

    Is there a way to take this check further? I like being able to validate that the string they enter is a legitimate email format, but I want to be certain that the email they submit is a valid email from a list of validated emails.
    The purpose of this is to keep the emails spelled correct. Also supposing somehow one of our office staff mis-type their email, I'd like to be certain that it gets to them anyway. (Or at least tells them they need to re-type their email.)

     

    Previously I had experimented with (Get Response Details > Responder's Email) but that didn't work for two members of our staff. They both have legitimate Microsoft Office accounts.

    I'll implement the code you supplied as well.

  • Verified answer
    PrasadAthalye Profile Picture
    on at

    If you would like to validate email of the person who submitted and the person is domain user, you can use Get user profile (V2)' action using the email as mentioned in the above thread.

  • Community Power Platform Member Profile Picture
    on at

    Prasad,

    It might be something I haven't set up yet but I was having a difficulty with using the method you mentioned above. When I submit a response from my boss's account, my flow always works with the Get user profile (V2) method. However, when my supervisor submits a response, the flow redirects the email to my boss's account.

     

    Any idea what I'm missing?

     

    Thank you very much for your help, Prasad!

  • PrasadAthalye Profile Picture
    on at

    Sorry. Can you tell me what do you mean 'flow redirects the email to my boss's account.' ? Get User profile should read user profile of your boss using his email address since he submitted the form.. Do you see a different behavior?

     

    Can you upload screen shot of the flow execution for the response that your boss tested and explain so that I can help?

     

  • Community Power Platform Member Profile Picture
    on at

    @PrasadAthalye wrote:

    Sorry. Can you tell me what do you mean 'flow redirects the email to my boss's account.' ? Get User profile should read user profile of your boss using his email address since he submitted the form.. Do you see a different behavior?

     

    Can you upload screen shot of the flow execution for the response that your boss tested and explain so that I can help?

     


    When my supervisor is responding to the form with his account logged in my Get User Profile v2 method in my flow instead sends the email to my boss's account.

     

    I'll see if I can duplicate the behavior and attach screenshots.

     

    ...Prasad, I come back to you feeling remorse. LOL!

     

    I had confused the two methods I was using. I had NOT been using the "Get User Profile v2" method, I had been using the Responder's Email method from the Forms' dynamic content. This "Responder's Email" method was causing the email to go to my boss, not my supervisor! Woops!

     

    I'll replace it for the Get User Profile v2 method, which seems more proper to me now that I'm aware of it.

     

    If I have further difficulties I'll reach out to you again here.

     

    Thank you very VERY much for your help, Prasad! I'd still be stuck in the mud without your help! You're amazing!!!

  • ericwhitley Profile Picture
    137 on at

    This is pretty good but it only checks for the '@' and the '.' must appear after that, it's missing other portions of the email format.

     

    Does anybody have code that will test for user@domain.com?

     

    This will test for the "user" portion of the email, combined with @PrasadAthalye 's original code:

     

     

    and(greater(length(first(split(variables('email'),'@'))),0),contains(last(split(variables('email'),'@')),'.'))

     

     

    Still need to test for the "domain" and "com" portions, just haven't had time to work on it.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard