cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Prodigy
Post Prodigy

How to extract some portion of people picker display name to use in email body

Hi,

 

I have a requirement where I am using people picker field in a list and have a flow tied that performs bunch of tasks.

People picker returns display name in flow run as 'John, Taylor' (the way user profiles are created there is a comma between first and last name)

 

So from the example above, I would like to simply extract John. So dynamically would like to extract portion before the comma. Can someone please help me with the solution, thanks in advance. 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User II
Super User II

Re: How to extract some portion of people picker display name to use in email body

Hi @dmistry 

 

substring(split(items('Apply_to_each_2')['Author']['DisplayName'],',')[1],0,1) this will give first character after ','
 
-----------------------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

4 REPLIES 4
Highlighted
Super User II
Super User II

Re: How to extract some portion of people picker display name to use in email body

Hi @dmistry 

 

To get the first name from display name you should use split with index to get the first name.

 
here is an example:
split(items('Apply_to_each_2')['Author']['DisplayName'],',')[0]
 
PLEASE note text in red is the column name in my flow and i am getting all items form list so there is a loop (apply to each). replace this with the column name that you using.
 
-----------------------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Highlighted
Community Support
Community Support

Re: How to extract some portion of people picker display name to use in email body

 

Hi @dmistry ,

 

Is the People picker person field?

If yes, you could also use Get user profile action to get Surname and Given Name.

You could configure person email in the User field and get more info about the user.

Image reference:

149.PNG

Please take a try and feel free to let us know if you have any other questions.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Post Prodigy
Post Prodigy

Re: How to extract some portion of people picker display name to use in email body

@DeepakS  Is there a way to just get first letter after the ',', can you please advice with the correct expression for that as well, thanks in advance.

Highlighted
Super User II
Super User II

Re: How to extract some portion of people picker display name to use in email body

Hi @dmistry 

 

substring(split(items('Apply_to_each_2')['Author']['DisplayName'],',')[1],0,1) this will give first character after ','
 
-----------------------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (5,899)