Thursday, July 7, 2011

Capture task ID for approval task in SharePoint Designer 2010

Assigning the task ID to a field in the current item:
You can access the Task ID from the within the task behaviour. Click on "Change the behaviour of a single task"

The best place to set the field in the list / library would probably be in the "Before a Task is Assigned" "When a Task is Pending". You can add a "Set field in current item" action or if you wish to assign it to a workflow variable you can use the "Set Workflow Variable" action.

3 comments:

  1. I tried this and I do not get anything.
    I made a variable and then logged it to see the results
    I used Current Task; ID
    ANy suggestion would be helpful. I so need that task id for a secondary workflow

    ReplyDelete
  2. Hi Jeanne,

    Instead of setting your variable in the “Before a Task is Assigned” section, set it in the “When a Task is Pending” section.

    A colleague of mine had the same issue.
    I’m not actually sure why mine is working as I read another article that states the Task Id is not yet available on the task creation step, but only once it has completed.

    I will update the blog to use the “When a Task is Pending” instead.
    Thanks for the comment.

    ReplyDelete
  3. this helped and worked me @“When a Task is Pending” did not work @“Before a Task is Assigned” Thank YOU...

    ReplyDelete