Calculated Fields Parsing Numbers


Badge +1

I have an issue with the calculated value control whereby it will parse the calculation result as an integer despite my explicit declaration that it to "save as data type" as a string. The reason this is a problem is because I want to use the value of the calculated field later in the form to filter another drop down control.

 

When I configure my calculated value control with the following formula to retrieve the first 3 chars of my drop down (after parsing the lookup and getting the value)

substring3.PNG

I correct am returned a value of "02:"

substring3output.PNG

 

However if I change the formula to return just the first 2 chars of the same drop down value

substring2.PNG

I am presented with a calculated value control value of "2". It's as though, despite as above I'm saying store the value as a string (I want to maintain the prefix of 0 if it's there) it is parsing it as an int.

substring2output.PNG

 

Does anyone know a workaround for this?


9 replies

Userlevel 6
Badge +16

You can use a regular expression with the replace function:

replace(LambPlot ,":(.*?)*" ,"" )

In this case:

If LambPlot is 02: [ Ewes(3)blablabl

the regular expression will match : [ Ewes(3)blablabl

and will be replaced with empty

Badge +5

I've also found this to be an issue sometimes. If it's a "number" string, it seems to be converted to a number regardless of what you do. I did find a little work around by using "" + yourField instead of just your field. (the concatenation of an empty string "" plus your field may fool it happy.png

Badge +1

Thanks for the hints guys but Fernando Hunth the replace() with a regex also exhibits the behaviour. This is because the value string is passed to the faulty control regardless of how it was generated. This also occurs if I just set the formula of the calculated control to be 02, the 0 gets stripped off.

Jan Potyka​ , good hint but unfortunately it didn't work in this case sad.png

Badge +3

Any idea when this will be fixed?  I need to use the lookup function to access numbers with leading zeros and I can't at the moment sad.png

Userlevel 5
Badge +13

Any update on this issue?  I'm running into this issue on a current client project.

Badge +3

Nope, I ended up using javascript CAML queries to get mine complete.

Badge +8

I'm experiencing this problem as well and it is very annoying.  My temporary 'fix' is to use an uppercase letter 'O' as a stand-in for '0' for those cases where it is used only for display (with the right font it is hard to tell the difference).  Of course, this won't work when this field is needed to lookup values in another.

Userlevel 5
Badge +13

I contacted Nintex Support and they said their development team is targeting a fix for this issue to be part of their January product release.

Badge +8

That's great news, Eric.  Thanks.

Reply