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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Automate
Unanswered

Extract First Name

(0) ShareShare
ReportReport
Posted on by 310

I am using a flow to extract send an email once a row is inserted in a SP list.

 

In the email body, I will like to use the User's First name.

Currently, I am using "CreatedbyDisplayName" which has the full name of the users. How to I extract just the First name?

Categories:
I have the same question (0)
  • jinivthakkar Profile Picture
    4,187 on at

    @Canadiansal You can use following action and try Preferred name

     

    jinivthakkar_0-1612716963337.png

     

    jinivthakkar_2-1612717003983.png

     

    --------------------------------------------------------------------------------
    If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

     

  • jinivthakkar Profile Picture
    4,187 on at

    @Canadiansal If you just want to get from CreateByDisplay name, you can get by initialise the variable and the default value would be 

     

    split(triggerOutputs()?['body/Author/DisplayName'],',') /*splits by comma(,) */

     

    jinivthakkar_0-1612718045663.png

    and then as need refer the index which has your required data.

    variables('varFName')[0] /*gets first name in 0th index */

     

    Please note: I have split the value by comma "," as my name display name is Jiniv, Thakkar and then I took the 0th index which gives me my first name "Jiniv"

     

    --------------------------------------------------------------------------------
    If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

  • VictorIvanidze Profile Picture
    13,073 on at

    Hi @jinivthakkar, good solution but rather "Given Name" is equivalent of the First Name, not "Preferred Name".

  • MLCarter1976 Profile Picture
    51 on at

    @VictorIvanidze I wanted to thank you as I was asked to "hey can you make that display name a first name?"  Uhhhhhhhhh suuureee.

    So I went to the interweb and here I am!  THANK YOU!  I appreciate it.  I struggle with the Power Platform, yet see the value in it.  I am an IT Pro who handles administration better than low code solutions.  So thank you!
    This is what I have working, maybe it is not working, if so, I am open to suggestions / recommendations / best practices!

     

    When people submit items to nominate their favorite thing, I do a SPO, "When an item is created" and then to the variables I go!

     

    I create one string and have it ready to accept the given names of persons.

    1.png

     

    We have a need to include the person and their manager, so I go and grab all their names in a condition for yes / no, based on if their email address is null (empty / blank).

    If it is then I add it to items and get their email address and I think I have to search for them as well and then I can get their manager name / email to write to the person and their manager.  I found that I have to set the variable and then append to it, oh I didn't include the other initial variable I have for each person. So I have one for the person and then for all the persons, IF they exist and then I found I had to append the semicolon for their email (another variable and append) and a comma, for given name (to make it look nice).

    2.png

     

     

    Then way down in email, I go to the variables, I have a few!  One for the email which for me is the "mail" for the persons (I have one for the managers email too) and the string email goes in the TO field and the given names go in the subject line to indicate to others a more personal feel.  I have to put in the (above) append to for he semicolon or comma or else it won't work and will all be jumbled together.  My next "step" is to figure out how to get rid of that last comma for persons to not make it look weird.

     

     

    3.png

     

    You've helped me so I thought I'd let you and others know what it did for me!  THANK YOU!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard