Replace everything before or just get login id?


Badge +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

Userlevel 5
Badge +14

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

try following

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

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

Badge +8

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

userProfileLookup(ctrlRequestor,"UserName")

Userlevel 5
Badge +14

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

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

Reply