Skip to main content
Nintex Community Menu Bar

Removing 234;# ID from the front of user name with Regular Expression


Forum|alt.badge.img+1

I Recently had a request to get a Project Manager name that is linked to a project when the user selects a project number from a drop-down control.

 

I managed to get the Project managers name using this formula : lookup("Project List", "Project_x0020_Number", parseLookup(Project), "Project_x0020_Manager"). The only issue was I was also getting the ID along with the name. e.g.  234;#Joe Soap.

 

So, to fix this I used a regular expression to remove the ID from the front of the Project Managers name.

 

Steps I took:

1. I created a Form Variable. The formula I used to get the project managers name is : lookup("Project List", "Project_x0020_Number", parseLookup(Project), "Project_x0020_Manager")

 

"Project List" - is the name of the list that has the project number and project managers name in it.

"Project_x0020_Number"  - is the Project number for the Project. 

"Project" is the name of my drop down control that displays the list of Project numbers in it.

"Project_x0020_Manager" - is the name of the column in the "Project List" list that has the Project managers names in it.

 

 

2. I added a Calculated Value control to my Form. I used the regular expression in the formula to remove the characters before the #. 

This is the formula : replace(GetPMName, ".*#", "")

 

"GetPMName" - is the name of the form variable I created that holds the Project manager name with the ID attached to the front. e.g. 234;#Joe Soap.

".*#", ""  - is the expression I used. It removes everything before the # and replaces it with a empty string.

 

 

End result : Joe Soap.

 

Hope this helps someone. 

Did this topic help you find an answer to your question?

3 replies

Forum|alt.badge.img+11
  • Scout
  • 357 replies
  • November 6, 2018

Good alternative to using parselookup(), which also removes the 'prefix'.


Forum|alt.badge.img+1
  • Author
  • 3 replies
  • November 7, 2018

Thank you, Jean-Pierre.

True, parseLookup() will also remove the ‘prefix’, though I found it did not work well when I used it.  


hayleea0601
Forum|alt.badge.img

Thank you! This was very helpful.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings