Can I get the last name of the current user in K2?

  • 16 August 2017
  • 1 reply
  • 22 views

Badge +5

I am trying to fetch the last name of the cuurent user from the display name. But, I can achive the complete display name can't split the last name of the current user. We can split using custom code like jquery. But, if the current user has display name like 4 names (ex. Divya Dharshni Venkat Sakthi [divyadvs]) how can we do split here. Is there any possiblities to achive my goal in K2 itself? If yes, Kindly suggest the solution.


1 reply

Userlevel 3
Badge +16

Hi,

 

I have faced a similar scenario before, we have AD names like surname, firstname. I was able to achieve this using expressions.

 

There is no reason why you can't do something similar on the CurrentUser - Try using an expression to split the names using something like:

 

Mid (DisplayName, Find (DisplayName, <blank space>) , Length(DisplayName)) - this gets firstname for example

 

 

Reply