cancel
Showing results for 
Search instead for 
Did you mean: 
stempb
Nintex Newbie

Replace everything before \ or just get login id?

Jump to solution

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.

Reply
5 Replies
Automation Master
Automation Master

Re: Replace everything before \ or just get login id?

Jump to solution

yes, with a slash it's little tricky

try following

replace(userProfileLookup(ctrlRequestor,"AccountName"),"^[^\\\\]*\\\\","")
0 Kudos
Reply
stempb
Nintex Newbie

Re: Replace everything before \ or just get login id?

Jump to solution

Thanks!    Why are 4 slashes required?   I understand why 2 would be needed.   But 4?

0 Kudos
Reply
Highlighted
stempb
Nintex Newbie

Re: Replace everything before \ or just get login id?

Jump to solution

This is actually  easier and it works.   No replace needed.

userProfileLookup(ctrlRequestor,"UserName")

View solution in original post

0 Kudos
Reply
Automation Master
Automation Master

Re: Replace everything before \ or just get login id?

Jump to solution

since special meaning of backslash needs to be escaped twice - once for javascript and second time for regular expression

0 Kudos
Reply
jagadeeshkarri
Nintex Newbie

Re: Replace everything before \ or just get login id?

Jump to solution

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!!

0 Kudos
Reply