Skip to main content
Nintex Community Menu Bar

Replace everything before or just get login id?

  • July 11, 2017
  • 5 replies
  • 13 views

Forum|alt.badge.img+8

Userprofile  function on a form returns something like

DOMAINLoginID123

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"),"^[^]*"

5 replies

Forum|alt.badge.img+14
  • Scholar
  • July 12, 2017

yes, with a slash it's little tricky laugh.png

try following

replace(userProfileLookup(ctrlRequestor,"AccountName"),"^[^\\]*\\","")

Forum|alt.badge.img+8
  • Author
  • July 12, 2017

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


Forum|alt.badge.img+8
  • Author
  • July 12, 2017

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

userProfileLookup(ctrlRequestor,"UserName")


Forum|alt.badge.img+14
  • Scholar
  • July 12, 2017

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


Forum|alt.badge.img+3

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 (DOMAINLoginID123,DOMAINLoginID123).  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!!