Solved

Need to remove extra characters from calculated value

  • 31 May 2023
  • 5 replies
  • 56 views

Badge +2

I am using a calculated value to populate the name from another sharepoint list. It returns the name but with the prefix “6;#” so how do i get rid of that?  

lookup("siteURL|Workflow Configuration List", "Title", "Advansys Manager", "Person")

icon

Best answer by Garrett 31 May 2023, 21:54

View original

5 replies

Userlevel 6
Badge +16

Hi @dpstear 

You can use either the REPLACE or SUBSTRING functions

 

REPLACE Example 

Text Source → lookup("siteURL|Workflow Configuration List", "Title", "Advansys Manager", "Person")
Expression → “6;#”
Replacement → “”   

 

replace( lookup("siteURL|Workflow Configuration List", "Title", "Advansys Manager", "Person"), “6;#”, “”)

Searching for “6;#” and replacing with empty string.


 

https://help.nintex.com/en-US/office365/Designer/Functions/replace.htm

 

 https://help.nintex.com/en-US/office365/Designer/Functions/substring.htm

Hope that helps

Badge +2

Thanks Garret, that worked! Actually both ways work but sometimes the first digit (the 6 in my example) is not always a 6 and sometimes it’s a 2 or 3 digit number so how would I remove that?

Thanks for your help!

Userlevel 6
Badge +16

Hi @dpstear 

 

Use the REPLACE function which supports Regular Expression or REGEX

Text Source → lookup("siteURL|Workflow Configuration List", "Title", "Advansys Manager", "Person")
Expression → "\\d{1,3};#"
Replacement → “” 

 

replace( lookup("siteURL|Workflow Configuration List", "Title", "Advansys Manager", "Person"), "\\d{1,3};#", “”)

 

The Expression will search for → between 1 to 3 digits

;#Garrett → ;#Garrett     //No match
3;#Garrett → Garrett
23;#Garrett → Garrett
123;#Garrett → Garrett
0123;#Garrett → 0Garrett 

 

Hope that helps

Badge +2

Thanks so much Garrett, that works perfectly!

Userlevel 4
Badge +10

Hi,

You can also use the function ‘ParseLookup’

https://help.nintex.com/en-US/office365/Designer/Functions/parseLookup.htm

 

This function is here o remove this special extra characters ;)

 

For exemple : 

parselookup(lookup('MyList','ID',3,'Author'))

 

Reply