Form creating two of the same Issue ID

  • 24 October 2017
  • 2 replies
  • 9 views

Badge +3

I have a list called an "Issue Log" that users fill out a form to log new issues with. I have a field in the form called Issue ID that is connected to a column of the same name. Not sure how but I have ran into a problem where it is creating duplicates of the same Issue ID. This doesn't always happen and seems to be at random. The workflow is set up to Query the list and store the results in a variable called "nextNumber">then I set a variable "prefixedNextNumber equals value fn-padLeft(nextNumber4,0)" then I build a string I-{WorkflowVariable:prefixedNextNumber} and then set a field value of Issue ID equals WorkflowVariable:prefixedNextNumber, I do a math operation calling on Workflow Date nextNumber plus 1 and store the result in another variable called nextNumberPlus1, I update the item in Master Numbering List-Issues, set variable to prefixedNextNumber list look up current item Owners and lastly set the variable textAssignedTo list look up current item Owners before requesting approval


2 replies

Badge +9

You can get a unique ID by creating a new list item and using list item ID not by updating a counter in a list item.

By creating a new list item you get a 1-based integer ID, which is one greater than the ID of the item that was previously added. If the item is deleted, its ID is not reused (see https://msdn.microsoft.com/EN-US/library/microsoft.sharepoint.splistitem.id.aspx ).

Userlevel 5
Badge +14

the reason is not random.

the reason is that more then one user (or event) are about to create new entry at about the same time. so they both/all see the same value of the counter at the beginning.

there is no other reliable way in sharepoint to get unique identifiers then to rely on item ID.

for your simple case I'd recomend that you update issue-ID with workflow started once the item is creted.

Reply