cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
crmart1n_mx
Frequent Visitor

Variable to format name from O365 profile into initials

I'm looking to build out a rather simple flow that will take certain information from a MS form and output it as an email sent from a shared mailbox.

 

My question however, is that for the email signature of the outgoing email, I'd like it to be in the format of "First Name/First Initial Last Initial" - example, "Chris/CM"

 

Is there a way to perhaps build a variable or something that if I were to extract their name using the Office 365 Get user profile function?

 

Thank you so much in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
v-yujincui-msft
Community Support
Community Support

Hi @crmart1n_mx ,

 

Maybe you could try the following expression:

concat(first(split(outputs('Get_user_profile_(V2)')?['body/displayName'],' ')),'/',substring(first(split(outputs('Get_user_profile_(V2)')?['body/displayName'],' ')),0,1),substring(last(split(outputs('Get_user_profile_(V2)')?['body/displayName'],' ')),0,1))

I have made a test for your reference.

vyujincuimsft_0-1652945539250.png

Result Screenshots:

vyujincuimsft_1-1652945604073.png

vyujincuimsft_2-1652945677994.png

 

 

Best Regards,
Charlie Choi

View solution in original post

2 REPLIES 2
v-yujincui-msft
Community Support
Community Support

Hi @crmart1n_mx ,

 

Maybe you could try the following expression:

concat(first(split(outputs('Get_user_profile_(V2)')?['body/displayName'],' ')),'/',substring(first(split(outputs('Get_user_profile_(V2)')?['body/displayName'],' ')),0,1),substring(last(split(outputs('Get_user_profile_(V2)')?['body/displayName'],' ')),0,1))

I have made a test for your reference.

vyujincuimsft_0-1652945539250.png

Result Screenshots:

vyujincuimsft_1-1652945604073.png

vyujincuimsft_2-1652945677994.png

 

 

Best Regards,
Charlie Choi

crmart1n_mx
Frequent Visitor

This is brilliant and worked perfectly. It's much appreciated.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (5,183)