How can i extract Last name only from Display name of a person field?

  • 28 February 2020
  • 2 replies
  • 108 views

Badge +1

Using Nintex 2013.  Within a workflow, I'm trying to extract just Last name from a Variable that is set to DisplayName of a Person/People column.   So if Display Name is Smith, John  then I want to just get Smith.   Goal is to put the last name in a Notification Email subject, such as

Subject:  Attention - Smith - please approve. 

I'd like to use some kind of function or combination of functions such as Mid.   Any ideas? 


2 replies

Badge +7

Not sure if this would work but it's something I'd try.

Create variables to hold the display name and last name (strDisplayName, strLastName)

Set the variable to the display name.

Use a Regular Expression Replace action using a pattern ",.*" (comma, period, asterisk) to grab everything to the left of the comma:

 

6623i61F9A986BE56D5B4.jpg

Userlevel 6
Badge +22
Hi,

I would do as Jeff advises or put the variable through a User Profile lookup action to lookup the Last name of the user.

Reply