parseInt (@Unique ID)
AnsweredHello,
I have application with Unique ID on, and I need calculation field that Add some number constant to Unique ID
my example for Item unique ID = 10, the right result must be 12
If I wrote "@Unique ID + 2" PODIO returns 102 (as a string)
But when I wrote "parseInt(@Unique ID) + 2" PODIO returns error: "The result is not a valid number"
What I'm doing wrong?
-
Hi Павел,
your solution is correct from a JavaScript perspective, but Podio is being hard on you because it uses "test data" in the @Unique ID field that is not a number. (It usually uses "INV-123" for the unique id in this case and
parseInd('INV-123')
will result in NaN (ie. not a number)). But this work-around does the trick:var uid = parseInt(@Unique ID); isNaN(uid) ? 0 : uid +2
This will return 0 if the unique id is really not a number (which shouldn't be the case after you save the app, and uid+2 otherwise. More importantly, this will let you save your calculation without Podio complaining. :)
Best,
StefandieKollaborateure.com - Podio Training+Consulting+Development English & Deutsch
Please sign in to leave a comment.
Comments
1 comment