I have a purchase requisition field within a Nintex Form and I need to set a rule that would allow either 8 or 9 digit length numbers. I thought I would just set a form variable to make this determination at runtime using:
However, after testing this using a calculated fielded on the form, I noticed it would return "#value! " if I entered into this field "123" or any fully numeric string. If, on the other hand, I entered "123a" then I would get a correct length of 4.
Obviously length() seems only capable of working with either an alpha or alpha-numeric string and not a fully numeric string.
Originally I had planned on using this variable within a validation rule and the "||" or logic to enable this but without being able to determine the length of a fully numeric string I am stuck.
Does anyone know a way around this or perhaps has another idea of how to accomplish this type of validation?
Solved! Go to Solution.
OK just be careful I looked at another post earlier, similar issue, where substring ignores any leading zeros. it happens on above solution too. so if you are likely to have leading zeros you will need something else (though I can't work out what yet)!
This seemed to work until I got to 23 numbers. For example, the string "012345678901234567890123" returns 22 as the length. Numbers beyond that continued to report 22. If I add a character to it, it returns the correct value. If I remove the character, it goes back to 22.