Not applicable

Need help getting Display Name from a Person or Group list item

Jump to solution

I have a SharePoint list column that is Person or Group and would like to extract the Display Name in a workflow control. We are using O365 Forms and Workflow.

The column is Employee Name and the list properties for it show as Name so the SharePoint list works but when I use the Current Item in workflow I get something like this > %$#[members]userloginname@domainname - I would like to get the users first name last name for display on a calendar.

I'm using a Update List Item in workflow and it doesn't have an option for Display name for all the Person or Group columns on the right nav. Only has that option for the initiator which is the person logged in and not the one I want.

Any help would be appreciated.

Thanks,

Shari

Tags (1)
0 Kudos
Reply
7 Replies
andrewg
Scout

Re: Need help getting Display Name from a Person or Group list item

Jump to solution

Actually, you already have this data. When you are using the Person field from the current list item or even from a query of a list item you can format the field to provide you the user's value of

  • Display name
  • Login/username
  • email
  • user id number

If you store this in a variable you can also use the formatted value where ever you like. Use the Format this Value function to do so. For examples, please see Using the Format this Value Feature

Reply
Not applicable

Re: Need help getting Display Name from a Person or Group list item

Jump to solution

Thanks Andrew,

I was able to follow your instruction and make the changes I needed. I does help to know that the Java Function symbol is called 'Format this value' function in documentation.

Reply
jaapsteenis
Novice

Re: Need help getting Display Name from a Person or Group list item

Jump to solution

Hi Andrew, thanks for the tips. Can you explain how I can get the FirstName and LastName from a given column (say columns called Observer from the type People/Users) ?

0 Kudos
Reply
andrewg
Scout

Re: Need help getting Display Name from a Person or Group list item

Jump to solution

Sure, if you have a field or a variable of type Person then you can use the same principals above. Follow the link to the format this value feature. You can get the display name of the person this way. If you have to split the name, then you can use the Reg Ex action to split it.

Reply
jaapsteenis
Novice

Re: Need help getting Display Name from a Person or Group list item

Jump to solution

Hi Andrew, I did indeed return the DisplayName as Steenis, Jaap followed by a RegEdit Replace as follows:

Input string (the field Owner) returned as DispayName

Pattern: \W+, and a space

Output set to variable called firstName

That works perfectly,

What (Regular Expression) Pattern do I need to extract the LastName Steenis in Steenis, Jaap ?

0 Kudos
Reply
kmorry19
Novice

Re: Need help getting Display Name from a Person or Group list item

Jump to solution

Hey Jaap Steenis

You could try ^\w* as your regular expression

   ^ will assert the start position of the string

   \w matches any word character 

   * matches between zero and unlimited times

Just tested it in an online regex tester on a few user cases and worked for me 

Let me know if that works for you

Thanks,

Kimberley

Reply
jaapsteenis
Novice

Re: Need help getting Display Name from a Person or Group list item

Jump to solution

Fab, Thanks very much for the help !, It works.

Reply