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
abm
Super User III
Super User III

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 III
Super User III

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

abm
Super User III
Super User III

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

 

abm
Super User III
Super User III

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 III
Super User III

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

abm
Super User III
Super User III

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
abm
Super User III
Super User III

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

abm
Super User III
Super User III

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

abm
Super User III
Super User III

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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (2,400)