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 Automate
Answered

Email salutation

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

In my flow, I am sending the DisplayName and email from a power app.  I want to include the user first name in the body as a salutation.  How can I extract just the first name from DisplayName?  Is there a way to do a substring, or Right function? 

 

Thanks for the information

 

Brad

Categories:
  • Verified answer
    ScottShearer Profile Picture
    25,331 Most Valuable Professional on at

    Here is an example that should help.

     

    In my test, I am getting the display name from a variable called varDisplayName.

     

    substring(variables('varDisplayName'),0,indexOf(variables('varDisplayName'),' '))

     

    I an using the substring() expression - I am saying that I want part of a string and I want to start at position 0.

    I am also saying that I want a certain number of characters - I am looking for the first space and retrieving the position of that space using the indexof() expression.  The position of that space is the number of characters I want.

     

    If you need additional help, please post here.

     

    If this solves your issue, please mark your question as Solved.

     

    Scott

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks, exactly what I needed

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I thought that is what I need.  Our Display Name from the adfs is LastName, FirstName and this substring formula returns the LastName only.  So I would need everything after the comma.

  • Verified answer
    ScottShearer Profile Picture
    25,331 Most Valuable Professional on at

    OK - try this

    first(split(variables('varDisplayName'),','))
     
    Split breaks the string into two parts broken at the comma.
    First gets the first row in the table that was created when breaking the string at the comma (i.e. the last name).
     
    Scott
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Yep, that did work, except I changed "first" to "last" as I want the first name in the salutation.  Thank you for your help

  • ras1000 Profile Picture
    52 on at

    This very close to what I am endeavouring to for the email salutation.  I used

     

    substring(variables('FatherFirstLast'),0,indexOf(variables('FatherFirstLast'),' ')

     

    however, get a "Definition contains invalid parameters." message when I try to save the flow.

     

    So far, I have not been able to sort out why I am getting the error.

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
Mohsin Ali Profile Picture

Mohsin Ali 430

#2
11manish Profile Picture

11manish 341 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 282

Last 30 days Overall leaderboard