cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dreavisPH
Regular Visitor

Automatically ceate emails for users with the same name

Hi,

 

When we hire someone there information automatically populates in an excel sheet. I designed a flow that automatically creates the users email account in Azure AD. The problem comes when two users have similar names. Example Jason Smith and John Smith would both end up being jsmith@ and cause an error. How do I fix that?

1 ACCEPTED SOLUTION

Accepted Solutions
fchopo
Super User
Super User

Hello @dreavisPH 

In your excel file you could have 3 columns: Name, Primary Email, Secondary Email and do the following:

1) Get User in Azure AD with Primary ID

2) If the user is not found, it will throw an error, so you capture it and create the user with its Primary Email address.

3) If a user is found with the same Primary Email address, create the user with its secondary email address:

primary_email.png

 

To capture the error in the "Create User - Primary email" you should do the following:

01_runafter.png

 02_runafter.png

 

Hope it helps!

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

View solution in original post

2 REPLIES 2
fchopo
Super User
Super User

Hello @dreavisPH 

In your excel file you could have 3 columns: Name, Primary Email, Secondary Email and do the following:

1) Get User in Azure AD with Primary ID

2) If the user is not found, it will throw an error, so you capture it and create the user with its Primary Email address.

3) If a user is found with the same Primary Email address, create the user with its secondary email address:

primary_email.png

 

To capture the error in the "Create User - Primary email" you should do the following:

01_runafter.png

 02_runafter.png

 

Hope it helps!

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

This worked perfectly! Thank you!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (3,362)