Reset unique ID every year.
Hi,  Is there a way to use the  @unique ID and reset it every Year?  I was thinking about something like moment(@created on).format("YY")+@Unique ID and on the first of januari it wil start at 0001 again. Kind regards, Michael

  • Hello Michaël,depends on your setup. If you have access to the previous item (eg. with ID 190111, where 19 is the year) then you can check if the year changes. You need an additional field "unique _id" with @Unique ID (that's  not the field where you build 190111) and a field "created_on" with @Created on.For example for the first entry in 2020:  var prevID =@All of unique_id.toString();var prevC_ON = moment(@Max of created_on).format("YY");var C_ON = moment(@Created on).format("YY");var newID = C_ON == prevC_ON ? ("0000" + (Number(prevID) + 1)).substr(-4) : "0001" ;C_ON + newID Result for the first entry in 2020 would be: 200001 Otherwise it's not possible with a calculation field only, you would need another "Helper" app and Globiflow. If you are member in the Globiflow Workspace you can find some examples for your use case there.  Rainer
This question is closed.