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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to get the initial...
Power Automate
Answered

How to get the initial of a surname to use in user creation

(0) ShareShare
ReportReport
Posted on by 16

Hey all,


I'm building a new user creation flow to simplify the existing process. The format of users mail is:

Firstname.initialoflastname@contoso.com

 

flow.PNG

So I would like to replace the "lastname" in the MailNickname field and "lastname" in the UPN field with firstname.initialoflastname and I'm struggling to do so. I can see that there is a method of doing this with a concat expression but actually executing it is a problem.

 

Help would be hugely appreciated.

 

Cheers,

SP

Categories:
  • v-yuazh-msft Profile Picture
    Microsoft Employee on at

    Hi @Stellarprojects,

     

     

    Please refer to screenshot below to add the expression with concat:

    Capture.PNG

     

    The expression in the User Principle Name as below:

    concat(triggerBody()?['First_x0020_Name'],'.initialoflastname@contoso.com')

     

    Best regards,

    Alice

  • Stellarprojects Profile Picture
    16 on at

    Hey Alice,


    I have explained this poorly, I do not have the users initials available to me, so i'd like to get the initial of the surname if possible.

    I do have users First_x0020_Name and Last_x0020_Name, so is there a way to split the Last_x0020_Name to get the first letter only?


    Cheers,
    SP

  • Verified answer
    Stellarprojects Profile Picture
    16 on at

    If anyone is interested I solved this by using

    toUpper(substring(triggerBody()?['Last_x0020_Name'],0,1))
     
    Cheers

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 307 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 289

#3
Henil Profile Picture

Henil 127

Last 30 days Overall leaderboard