cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
annetoal
Helper V
Helper V

Validating email addresses

Is there a way for Flow to confirm that an email address is a valid email within our tenant? The emails would be taken from a SharePoint library.

 

Thank you,

Anne

1 ACCEPTED SOLUTION

Accepted Solutions

It an array so in Power Automate you can use the Loop controls to iterate the array. 

 

Add a Parse JSON. Generate the schema. Then add the search users action after that. Flow will automatically add the loop.



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

View solution in original post

14 REPLIES 14
abm
Super User
Super User

Hi @annetoal 

 

You could get the email say for example john.davidson@itwork.com

 

Suppose your tenant email address is @itwork.com then use a split() expression to validate the address domain is itwork.com

 

You could use the below expression

 

last(split('john.davidson@itwork.com'), '@'))

 

This should return itwork.com

 

Next could add an IF condition to check whether the domain address is itwork.com or not?

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

How about if the email is spelled wrong. john.davidson@tiwork.com or jonn.davidson@itwork.com would both pass your test. I need a way to look up an address against the list of addresses in the active directory for our tenant.

 

Thanks,

Anne

Hi @annetoal 

 

Please see below options you could use

 

image.png

 

IF you using Search for users then pass the email address. If you using the AD Get Group members then you need to use the Unique identifier of a group and search the email address from the results.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

I can't use the AD connector because it's not an AD group, and I don't have privileges to see inside groups. I am trying to use the Search for email connector but so far have not had any success. I've written this condition.

annetoal_0-1626991387176.png

Do I get a True/False from the Search connector? How does it signify when an address is not in the directory?

 

Thanks,

Anne

 

Hi @annetoal 

 

After the Search for users action step add a compose and add the below expression

 

length(outputs('Search_for_users_(V2)')?['body/value'])
 
Next Add an IF condition to check whether the value is 1 or 0. 1 means it found the record and 0 means no record found.
 
Thanks


Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials
abm
Super User
Super User

Hi @annetoal 

 

Do you need further help in this?

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials
bakers
Frequent Visitor

An easy way of handling this would be to use the try, catch pattern template ~

bakers_0-1627295635444.png

 



Yes, as it happens. Every address fed into the connector is being registered as bad, even when they are good. The length of everything is coming up as 0.

annetoal_0-1627313829336.png

 

The input to the searchUsers connector is

[
  {
    "reviewerEmail": null
  },
  {
    "reviewerEmail": "user.name@school.edu"
  },
  {
    "reviewerEmail": "user.name@fakeaddress.fake"
  }
]

The output is always 

[]

 

Thank you,

Anne

Hi @annetoal 

 

Not sure the search users input won't accept the content in array format?



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

See below

 

image.png

 

If that email exists then it will return 1 else 0.



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

Okay, what form does it accept?

 

Anne

Please see my last screenshot. Plain text email format.



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

Thanks. I entered email addresses manually into the search connector and it ran correctly. What should I do to feed addresses one item at a time from the array?

 

Thanks,

Anne

It an array so in Power Automate you can use the Loop controls to iterate the array. 

 

Add a Parse JSON. Generate the schema. Then add the search users action after that. Flow will automatically add the loop.



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (3,274)