Skip to main content
Nintex Community Menu Bar
Answer

Need to remove extra characters from calculated value

  • May 31, 2023
  • 5 replies
  • 239 views

Forum|alt.badge.img+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")

Best answer by Garrett

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

5 replies

Garrett
Forum|alt.badge.img+16
  • Scout
  • Answer
  • May 31, 2023

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


Forum|alt.badge.img+2
  • Author
  • Rookie
  • June 2, 2023

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!


Garrett
Forum|alt.badge.img+16
  • Scout
  • June 2, 2023

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


Forum|alt.badge.img+2
  • Author
  • Rookie
  • June 2, 2023

Thanks so much Garrett, that works perfectly!


nico
Forum|alt.badge.img+10
  • Rookie
  • June 5, 2023

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'))