Unique ID field as a number field
AnsweredHi Podio team,
Can you make the @Unique ID field as a number field whene we use it in Calculation ?
-
Hi Hamid,
Try using the parseInt() javascript function to convert from a string into an integer.
var num_id = parseInt(@Unique ID, 10);
-
Hi Christopher,
Thank's for your response, I try the parseInt() function but i have "the result is an invalid number" when i do num_id+@mynumber.the solution is to add this " " to the end of the calculation, but the field is converted to text !
var num_id = parseInt(@Unique ID, 10);
num_id + @mynumber+ " " -
@Christopher,
- mynumber is a number field.
- return numid itself give "the result is not a valid number".
- I use paseInt(@mynumber, 10); and return it itself then it give me a true result.
- But when i add mynumber to numid it return invalid result !var numid = parseInt(@Unique ID, 10);
var nombre = parseInt(mynumber, 10);
mynumber + numidthe result is not a valid number<<<
-
Hamid,
Hmm. Very strange. I noticed in your one example that there might be a typo.
var numid = parseInt(@Unique ID, 10);
var nombre = parseInt(mynumber, 10);
mynumber + numidIt should be mynumber + nombre
Unfortunately if this doesn't fix it, I'm out of ideas. Hopefully someone else will have an idea.
-
there is a snap of my exemple :
NB : I am in french version of Podio // sory for my bad english :)
no prefix : http://ovh.to/cQbr7Ur
the calculation : http://ovh.to/qKzJ28hThank you Christopher for your Help.
-
Just out of curiosity, are you editing this template while inside of an item? If you edit a template when you're not inside of an item it uses placeholders for all the fields in the app. I think Podio might use character prefixes in their placeholder values for the Unique ID's. Let me know if this makes sense.
-
Yes I am inside an item,
Look at this snap (i have a result in "Calcul ID2") : http://ovh.to/QstXuqd -
Hi David,
I am using the following formula in a proposal app to create an automatic numbring combined with the date (Month/Year) and the UniqueID wtith an initial value of an existing proposals :var date = moment(@Date).format('YYMM'); var compteur = 865 var id = parseInt(@UniqueID, 10)+ compteur; date+id
This guive me : 1502866, 1502867 ...
15 ==> for Year
02 ==> for Month
866 ==> Autonumbring incrementing by one each new proposal
@Date is a date field in the app
/Hamid
Please sign in to leave a comment.
Comments
17 comments