The Solution (I found by www.spankh.com/archives/121 (link now broken)):
The solution is to run the workflow twice on each item. Once to set the numeric SharePoint ID field, and once to use the numeric ID calculated column. let’s see the whole thing in action:
Create two custom lists:
- ID generator – This is a list that will be used to generate the title for our main list:
Title
SPID: Numeric
SPID00000: Calculated, Single line of text, =TEXT(SPID,"00000")
DateCalc: Calculated, Single line of text, =TEXT(Created,"YYMMDD")
2. Main List – This is our list that we want to set the title to YYYYMMDD-00000. (we only need a title field for this example):
Title
Create the workflow for the ID Generator list:
Workflow Step 1:
{Set Field in Current Item} Set SPIDNumeric to ID.
{Build Dynamic String} Store [CreatedYYYYMMDD]-[SPID00000] in Variable:NewTitle.
{Set Field in Current Item} Set Title to NewTitle.
Create the workflow for the main list:
Workflow Step 1:
{Create List Item} Create item in [ID Generator List], Set Title to "Title" (Output to Variable: create)
{Pause for Duration} Pause for 0 days, 0 hours, 0 minutes.
{Update List Item} Set Title to "Title". {in the Find the list item section: Field: [ID Generator List]:ID Value: Variable: create}
{Set Field in Current Item} Set Title to [fx]: Source: [ID Generator List], Field: [Title], {in the Find the list item section: Field: [ID Generator List]:ID Value: Variable: create}.
Viola! We have it! Create a few items in the main list and watch as they all update themselves to the ID number we wanted…