Stump the Panel » SharePoint Workflow for All Users

Workflow failing when trying to calculate next Item ID

(6 posts)
  • Started 1 month ago by NancyCentury
  • Latest reply from NancyCentury
  1. NancyCentury
    Member

    I have a workflow that keeps crashing at the same spot and I can't figure out why.

    I inserted "log to workflow history" after every single action and it looks like the "Calculate..." action is the culprit. Please help!
    _______________

    My list called "Process Steps" is a series of steps that must run in order each month. Every list item begins with a default status of "Not Started."

    Changing the status to "In Progress" or "Completed" triggers other workflows which are set to automatically run when an item is changed, with conditions to make sure it fires on the right items.

    Workflow 1 is a manual intitation whose purpose is to kick off the process for the month, and will only ever run on the first step (the "Kick off" step). Let's say the ID of the Kick Off step is 100. This WF also contains a variable called "ID number of next step".

    To produce the value for this variable, I have this action:

    then Calculate Process Steps:ID plus 1 (Output to Variable: ID number of next step)

    So- since the ID of Step 1 is 100, the result I am looking for is the value 101.

    I need this value to be available later in Workflow 1 to use in the "Update item in ___ list" action, where I tell the item whose ID matches my variable (the next consecutive step ID, 101 in this case) to update its status to "In Progress."

    That status update triggers a second workflow designed to run when an item changes, that then fires off its own set of actions, one of which calculates the ID of the next item, and so on and so on, so that each time a step's status is changed from In Progress to Completed, the next consecutive step is initiated by calculating the next consecutive ID number and updating the matching list item's status.

    The step that keeps failing is the very first Calculate step in Workflow 1. Is it not possible for a value produced by the 'Calculate...' workflow action to be used as a list ID variable?

    Is there a better way to make sure my steps are firing in order?

    Posted 1 month ago #
  2. NancyCentury
    Member

    Is the problem that a list item ID is not recognized as a "number" the way a regular numeric value is?

    I have created a variable via a calculation adding a list item ID (which is a number, but is it _really_ a number?) to 1, hoping to produce a value that is one greater than the original list ID.

    Posted 1 month ago #
  3. NancyCentury
    Member

    I see a fatal flaw in my idea, which is that I am running a workflow on item change, et I am changing the item twice within that same workflow. So that is another problem i will need to fix.

    But- the initial- and greater- question remains... how can you ensure AUTOMATIC sequential "activation" of a list item IN ITEM ID ORDER?

    That means- Completion of Item A (change from In Progress to Completed) causes Item B to fire (change from Not Started to In Progress); Completion of B launches C, and so on til the last item is complete?

    This is driving me crazy!! Can it be done?

    Posted 1 month ago #
  4. NancyCentury
    Member

    Just wondering if anyone had the time to jump in on this... thank you!

    Posted 1 month ago #
  5. Nancy,

    Did you output the value of the calculated ID to the log? What did it say?

    ID's should work like numbers but are not available to workflow items until the item has been created and saved.

    However, I would not think trying to predict the next Task ID would be very stable. Could you use different steps inside a single workflow instead?

    Posted 1 month ago #
  6. NancyCentury
    Member

    Actually, I used information here: http://masteringsharepoint.com/forums/p/404/965.aspx#965 to work out a method that worked. I gave up on using the ID as a field on which to base calculations.

    Posted 1 month ago #

RSS feed for this topic

Reply

You must log in to post.