Userprofile function on a form returns something like
DOMAIN\LoginID123
I would to get just the login id part put nothing seems to be working for me.
I tried:
replace(userProfileLookup(ctrlRequestor,"AccountName"),"^[^\\]*\\","")
and
replace(userProfileLookup(ctrlRequestor,"AccountName"),"^[^\]*\","")
but both give me errors. Any other character that is in the string works fine. It is the \ character that I am having issues.
Solved! Go to Solution.
yes, with a slash it's little tricky
try following
replace(userProfileLookup(ctrlRequestor,"AccountName"),"^[^\\\\]*\\\\","")
Thanks! Why are 4 slashes required? I understand why 2 would be needed. But 4?
This is actually easier and it works. No replace needed.
userProfileLookup(ctrlRequestor,"UserName")
since special meaning of backslash needs to be escaped twice - once for javascript and second time for regular expression
Hi Bruce,
I have to extract the login ids in a workflow. For Example I have two login ids separated by comma in a variable (DOMAIN\LoginID123,DOMAIN\LoginID123). I know how to extract single login id using the action regular expression in workflow. But I am unable to extract the two login ids. I tried using action 'for each' but its returning an error.
Any advice is really appreciated.
Thanks in advance!!