I have a value that is coming to me in the form of two digit number, semicolon, #, string of text. example being:
"03;#Red is a great color!"
I need to capture that two digit number. I was attempting subString(STRING,0,2) but if the STRING has a leading 0, it's being dropped and I wind up capturing "4;" instead of "04".
What's a good way around this?
Solved! Go to Solution.
You could use parseLookup function:
Parse the value of a lookup control.
parseLookup([array or single lookup value], [optional bool showText])
parseLookup('33;#Red is a great color!', False) --- > returns 33
parseLookup('33;#Red is a great color!') --- > returns Red is a great color!
I realize now that I had the wrong idea of what value was being passed to me. I have a column titled "Number" in which I have the details with a leading 0; and I have a column titled "Reason" with text in it. The value being passed to Nintex via List Lookup control is "ID;#REASON. I thought it was passing "NUMBER;#REASON" and couldn't figure out why it was taking the leading 0 off for items like "03;#Red is a great color!" when in reality it, there was no leading 0 because the ID of Red is a great color is 3, not 03.
So, to get around this, I just deleted the original items, and added them back to the list. Now that my first item starts with "39" as the ID, everything fits correctly.
Just a misunderstanding of what information was being passed to me.
once your item ID exceeds 99 you will run into the same problems again!
use parseLookup() function as advised by Cassy Freeman. that's what the function is designed for.