cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Super User III
Super User III

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

Highlighted
Super User III
Super User III

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
Highlighted
Super User III
Super User III

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

Highlighted
Advocate V
Advocate V

Re: Email salutation

Thanks, exactly what I needed

Highlighted
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.

Highlighted
Super User III
Super User III

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

Highlighted
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

Highlighted
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
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new 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!

Top Solution Authors
Users online (5,177)