Creating an unique approval number in a workflow

I was working on a workflow that assigns a unique approval number to an approved item. Despite the fact I made this workflow using Nintex, it is possible to create this workflow with SharePoint Designer (using the calculate function)

Requirements:
We have a list, where users can fill in a request to increase the quota of their site. The governance has decided that the IT department is responsible for the capacity, hence they need to be the approver of this request.
When a request has been approved, it should receive a unique approval number. The rest of the process is not relevant for this blog post.

Solution:
By using a combination of the ‘created date’ and the list item ID we can create a unique number. It was not required to use sequential number (was even preferred not to do this)

Setup:
In the custom list there are a lot of columns, but these are the once I have used to calculate a unique value for the approval number

Column name

Type

Year Calculated value : =TEXT((Created),”yyyy”)
Month Calculated value : =TEXT((Created),”mm”)
Day Calculated value : =TEXT((Created),”dd”)
ApprovalPart1 Calculated value: =DATE(Year,Month,Day)

Workflow variables:

ApprovalCalc : Text
ApprovalNumber: Number

Actions

In Nintex I created a Math Operation. It is configured to do “(Listlookup Current Item Approvalpart1) + (Listlookup Current Item ID)”.
This will result in having a number that is formed by  the number of days of the creation date (based on December 31 1899 being value 1) added with the itemID.
This value will be stored in the ApprovalCalc variable.
Then we have a build dynamic string action that build a string “STS- {WorkflowVariable:ApprovalCalc} and stored this value in the ApprovalNumber variable. (IT people wanted to have a prefix STS-).
The next action updates a list item called Approval_Number with the value of the ApprovalNumber variable and then other actions like sending emails and creating tasks is executed.

About Patrick Sledz

Patrick works as a consultant. He assists organizations to deliver SharePoint business value and create the awareness in these organizations that only a strong technical team is not sufficient to deliver this added value.

Tagged , , . Bookmark the permalink.