Auto Increment Number Starting with Year

I have a task list, and i would like to create an auto increment column when a new task is created. I also would like this number start and repeat every year. For example: 2017-001. 2017-002.... 2018-001, 2018.002.

I am very new in SharePoint calculated column and Designer.

Thanks in advance
SON NGUYENAsked:
Who is Participating?
 
Keyboard CowboyCommented:
I  use a workflow on the task list and an separate list to keep track of the numbering.  
You set up a separate list (called say IDTracker) -with the fields Title, NextID (number), and EndDate (date).
Create a  record with the values "TaskID",  NextID= 1, and  EndDate =  12/31/2018. (enddate is the last day to use this tracker value - it cycles below back to one after this date
I called the workflow variables all starting with var_ (to be clear here).
var_date of type 'Date',  var_n of type 'number' , the rest are strings

Then in a workflow on the task list -you do the following
First you need to see if the year has cycled - so .
set var_date = lookup value of column enddate on idtracker with title="TaskID"
If var_date < created date then
    then you need to update the ID tracker item
    add one year to var_date - place back into var_date  (use ADD time to a date action)
    update idtracker (title="TaskID") - with the new values nextid = 1 and enddate=var_date
endif
ok - now grab the next id (it may have been set to 1 above)
set var_n = Lookup column NextID in list IDtracker where title=taskid - (this is a number field!)
ok - let's format it - say something like yyyy-nnnn - like 2018-0010
Use extract to grab the "yyyy" from the created date and set to field var_yyyy (type string)
you can do this using extract from index of a string  from the created field value
set var_n_string to "0000" plus var_n  (this would give you something like 000010)
extract the last 4 chars from var_n_string - and place back into var_n_string - using extract from end of string.
This would give you something like 0010 for the end of your task id
set Task ID field in your task list to [var_yyyy]-[var_n_string}  -   using "set Field in current item to  (click on the ...) )
ok - now update the idtracker value for the next time this runs on another record.
add one to var_n - place back into var_n - using the Do Calculation action
update item in IDtracker  - set field NextID to var_n where title = "TaskID"

If you need to I can screen shot an example and send you snaps if you're new to workflows.  
you're done. - you can also cycle on Fiscal Years instead of calendar years if you want - whatever you set enddate to in the IDtracker list.
1
 
Keyboard CowboyCommented:
Let me know if you need additional help
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.