cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
guyinazo Advocate V
Advocate V

Email salutation

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

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: Email salutation

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

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

Super User
Super User

Re: Email salutation

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
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

6 REPLIES 6
Super User
Super User

Re: Email salutation

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

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

guyinazo Advocate V
Advocate V

Re: Email salutation

Thanks, exactly what I needed

guyinazo Advocate V
Advocate V

Re: Email salutation

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.

Super User
Super User

Re: Email salutation

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
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

guyinazo Advocate V
Advocate V

Re: Email salutation

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 Helper I
Helper I

Re: Email salutation

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.

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Users online (6,956)