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
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (1,384)