Unique ID Calculation
Hi, I'm trying to find a way continuing our job number sequence automatically.  I was wondering if there is a workaround using the Unique ID field...? I know this is a text field, but ideally I would want the calculation "@UniqueID + 5387"  which would bring each project into sequence. Would be grateful for any help! Thanks in advance. Joe

  • Hi Rainer, Would you please share how to strip the leading zeros from an App unique ID? Thank you. Michal
  • Hi Joe, Hamid's solution is good tip  - but I know, that not all users would follow and that items will be deleted. Creating consecutive numbers is cumbersome (if you use Globiflow it would be a bit more comfortable). One possible solution is: Create a new app (e.g. called "Count") with a title field and a calculation field "Number of projects", create only 1 item "Count 1".   Then add a relationship field to your projects app which points to the new app "Count", make this relationship field required. Reference each project to the item "Count 1" (this could be done automatically by Globiflow).  In the calculation field in app "Count" simply enter: @all of title field in projects.length - this counts how many projects are related. In the calculation field in projects enter: var id = Number(@unique id) + 5387;var numberPro = @sum of number of projects + 5387;var consecNum = id > numberPro ? numberPro : id;var consecNum2 = ("00000"+consecNum).substr(-5);@job name + " - #" + consecNum2 Result for item with unique id = 1 :  Job A - #05388Number Range would be 00001 to 99999unique id must be an integer, the pure id w/o prefix and leading zeros. If you have defined a prefix or leading zeros you have to strip them off. HTHRainerrg@delos-consulting.com  
  • Sorry, yet another question... if an entry is deleted the Unique ID still sees that deleted job so the next job entered will have missed a job number out. ie.     Job A - #001     Job B - #002 If Job B is deleted and then we add another job it will have the job #003, where we'd like it to read #002. Do you know if there is a way around this? Thanks.
  • Hi Joe, you've to parse the string (text) to a number. You can do that in mulitple ways (have all the same result):+@unique id + 5387orNumber(@unique id) + 5387orparseInt(@unique id) + 5387There's an additional step necessary. Because the calculation field expects a text if you enter "@unique id " and returns an error notification: Not a valid number: So you have to "persuade" Podio that it takes the parsed @unique id as a number:  +@unique id + 5387 || 123 123 can be any number. || means: OR This way you outwit the Podio Sandbox, it is satisfied cause it sees that there is a real number (123) as an alternative and it takes the calculation with the ID.  Rainer
This question is closed.