0

My SharePoint list is being updated by several users. I want an auto-increment column which should generate a unique ID and i want my id in following formate. CaseOPT0001,CaseOPT0002 and so on..

I have a solution by setting the following workflow but it generates only numbers like 101,102,103...which is not fulfilling my requirements.

enter image description here

I used the following link to generate that workflow
http://gihanmaduranga.blogspot.se/2012/09/create-auto-increment-number-column-in.html

1

Why are you creating something that SharePoint already does?

You can use the SharePoint default column ID in Workflows (as mentioned in the comments of the blogpost you refer to)

ID gets assigned after a New Item is created, so you can not use it in Calculated Column Formulas.

But Workflows are executed after the List Item is created so you can use ID in your workflow.

Only drawback might be, ID can not easily be reset, it will always increment

| improve this answer | |
1

My new workflow is here here is working perfectly for me.enter image description here

I followed this post for workflow: Auto-Increment Workflow Screenshots

Event Handler approach can be used also for Autonumbering if you are in programming but I haven't tested it!

| improve this answer | |
0

I'm trying to think of an alternate solution, but it seems you'll need to use a set of If conditions in the solution - that's if you want the preceding 000 prior to the ID value.

The workflow checks if the ID or the Next Number variable is within a certain range, and then append CaseOPT and the correct number of zeroes prior to the ID value.

Edit: The workflow would look something like this:

If Counter:Next Number is less than 10000
and Counter:Next Number is greater than or equal to than 1000
{
  Set Variable: uniqueIDString to (CaseOPT[Counter:Next Number])
}

If Counter:Next Number is less than 1000
and Counter:Next Number is greater than or equal to than 100
{
  Set Variable: uniqueIDString to (CaseOPT0[Counter:Next Number])
}

If Counter:Next Number is less than 100
and Counter:Next Number is greater than or equal to than 10
{
  Set Variable: uniqueIDString to (CaseOPT00[Counter:Next Number])
}

If Counter:Next Number is less than 10
{
  Set Variable: uniqueIDString to (CaseOPT000[Counter:Next Number])
}

Note:

  • This is using the format "CaseOPT####" as the unique id.

  • I've arranged it this way assuming most of your entries will be in the 1000 - 100 range. Rearrange it depending on how much items you expect and how fast your list grows.

  • Since you've placed the count on a separate list, if that value is manually tampered with, your values may no longer be unique. You might want to replace [Count:Next Number] with [Current Item:ID]
  • Clarification: (CaseOPT###[Counter:Next Number]) is the concatenation of a string CaseOPT### and value [Counter:Next Number] pulled from another list.
| improve this answer | |
  • I am also thinking on the same pages. Could you please help me writing the workflow? I am not good at that. – Jenny Sep 1 '15 at 6:31
  • Updated to include workflow format – Oxossi Sep 1 '15 at 14:49
  • Did you write this workflow in SharePoint designer 2010 or ?? I don't really know where to write that. – Jenny Sep 2 '15 at 8:51
  • You'd have to build the workflow in SharePoint designer based on this format. You can't copy-paste it into designer. – Oxossi Sep 2 '15 at 12:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.