lgiambar
Apprentice

remove claim and domain from current user

Jump to solution

I have a people picker field (called EmployeeName) in my form that brings in the current users preferred name. I then have a calculated value field that matching EmployeeName to bring in the user name. However the user name comes in with the claim token and domain name when all I want is the user name. I have tried different options in the replace function of the calculated value field and I am close but cant get rid of the |\ does anyone know how to do this??

I tried using replace(EmployeeName, "i:0#.w|admhn\", "") but with the last backslash, nothing will load at all! When I remove the last backslash i get the |\ left. 

0 Kudos
Reply
3 Replies
chaitra_b_c
Apprentice

Re: remove claim and domain from current user

Jump to solution

Use the formula: subString(replace(EmployeeName,"i:0#.w|domain",""),2,length(replace(EmployeeName,"i:0#.w|domain","")))

Outcome:

0 Kudos
Reply
emha
Collaborator

Re: remove claim and domain from current user

Jump to solution

you have to escape these characters since they are given special meaning.

use

replace(EmployeeName, "i:0#.w\\|admhn\\\\", "") 
Reply
lgiambar
Apprentice

Re: remove claim and domain from current user

Jump to solution

Thank you so much!!!

Reply