cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Nintex removing leading 0 when using substring

Jump to solution

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?

Labels: (1)
Tags (2)
0 Kudos
Reply
8 Replies
Workflow Hero

Re: Nintex removing leading 0 when using substring

Jump 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!

Reply
Workflow Hero

Re: Nintex removing leading 0 when using substring

Jump to solution

Does that work for you? It still removes the leading zero for me.

0 Kudos
Reply
Workflow Hero

Re: Nintex removing leading 0 when using substring

Jump to solution

oh to be fair I only tried with the example given!

0 Kudos
Reply
Workflow Hero

Re: Nintex removing leading 0 when using substring

Jump to solution

Alright.

Well, I can't bold the title, so I edited the post to better reflect the issue. 

0 Kudos
Reply
Workflow Hero

Re: Nintex removing leading 0 when using substring

Jump to solution

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.

Reply
Workflow Hero

Re: Nintex removing leading 0 when using substring

Jump to solution

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.

Reply
Workflow Hero

Re: Nintex removing leading 0 when using substring

Jump to solution

It's a limited list that won't be added to.

Reply
Workflow Hero

Re: Nintex removing leading 0 when using substring

Jump to solution

never say never

one will remove and re-add few items to the list, just like you did above, and you're in there

Reply