cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
w0rmsp17
Level: Powered On

Customizing User Principal Name on Azure Create User Condition. EG fist letter of First Name + Lastname@email.com

example.png

 

 

Hello,

I'm creating a work flow for an onboarding request. Part of my flow include creation of Azure AD users.

Our company email format is 'first letter of First Name' followed by their surname @companyemail.com

 

I've been playing around with different expressions but cant seem to make it work. 

Any guidance would be appreciated.

 

Thank you

 

 

 

 
2 ACCEPTED SOLUTIONS

Accepted Solutions
Dual Super User
Dual Super User

Re: Customizing User Principal Name on Azure Create User Condition. EG fist letter of First Name + Lastname@email.com

Hey @w0rmsp17 

 

That First Name from a list is basically the column. Can you do this: initialize a variable by adding an initialize variable action before the current action and put the name of the variable as "First_Name" and then in the value, from the dynamic selector select the First Name column. 

 

Now if you use that expression, it should work for you. 

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

w0rmsp17
Level: Powered On

Re: Customizing User Principal Name on Azure Create User Condition. EG fist letter of First Name + Lastname@email.com

Awesome! I'm gonna try this. I'll let you know how it goes.

Thank you

View solution in original post

9 REPLIES 9
Dual Super User
Dual Super User

Re: Customizing User Principal Name on Azure Create User Condition. EG fist letter of First Name + Lastname@email.com

Hi @w0rmsp17 

 

You can get the first letter of the first name using the substring expression like: 

substring('tom',0,1), instead of 'tom' select the First Name from the dynamic selector here. And then you can use the concat function to append the outputs of above with the last name and the @ domain.com  string. 
 
Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
w0rmsp17
Level: Powered On

Re: Customizing User Principal Name on Azure Create User Condition. EG fist letter of First Name + Lastname@email.com

Hello,

Thank you for the reply. Very helpful information, I'll remember this for the future. I'm a little stuck though I'm unsure how to reference variables in the 'expression'. Keeps throwing me errors. 

I get errors with this syntax "substring('First_Name'),0,1)"

 

 

Dual Super User
Dual Super User

Re: Customizing User Principal Name on Azure Create User Condition. EG fist letter of First Name + Lastname@email.com

Hi @w0rmsp17 

 

You can do something like this: Variable name: First_Name->

 

substring(variables('First_Name'),0,1)

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

w0rmsp17
Level: Powered On

Re: Customizing User Principal Name on Azure Create User Condition. EG fist letter of First Name + Lastname@email.com

Hey cheers,

It looks like the code is good. However I'm getting this error

Microsoft.png

 

Apparently I need to initialize this variable.

 

 

Dual Super User
Dual Super User

Re: Customizing User Principal Name on Azure Create User Condition. EG fist letter of First Name + Lastname@email.com

Hey @w0rmsp17 

 

Where are you getting the First Name from? Are you storing it in a variable at all? You might want to initialize a variable before this action and provide the name and then in the value, select the first name from dynamic content. It should resolve your issue then. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

w0rmsp17
Level: Powered On

Re: Customizing User Principal Name on Azure Create User Condition. EG fist letter of First Name + Lastname@email.com

'First Name' is a variable in a entered in a List. It should store it when the list has been submitted. 

 

When I enter in the User Principal Name in 'Create user' 

I select 'Add dynamic content' -> select 'Expression', I enter substring(variables('First_Name'),0,1)

 

click save and thats where the error prompts

 

thank you

Dual Super User
Dual Super User

Re: Customizing User Principal Name on Azure Create User Condition. EG fist letter of First Name + Lastname@email.com

Hey @w0rmsp17 

 

That First Name from a list is basically the column. Can you do this: initialize a variable by adding an initialize variable action before the current action and put the name of the variable as "First_Name" and then in the value, from the dynamic selector select the First Name column. 

 

Now if you use that expression, it should work for you. 

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

w0rmsp17
Level: Powered On

Re: Customizing User Principal Name on Azure Create User Condition. EG fist letter of First Name + Lastname@email.com

Awesome! I'm gonna try this. I'll let you know how it goes.

Thank you

View solution in original post

w0rmsp17
Level: Powered On

Re: Customizing User Principal Name on Azure Create User Condition. EG fist letter of First Name + Lastname@email.com

It worked. Thank you!

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Users online (4,705)