I have a custom process in a SharePoint 2010 workflow where I need to allow the first participant to be able to change the second participant in the participant list.

What I have tried is asking the 1st participant for the name of the second participant in the task form. I then use "Insert A Task Assigned to" in the "When A Task Completes" steps to add the second participants name.

This part works.

What doesn't work is the "Before A Task is Assigned" step. It seems references to the task are incorrect in this step for the second participant only, but correct for every other participant.

I have the following code in the "Before A Task is Assigned" step:

if Variable: counter equals 0
   set task field show_field to yes
   set task field show_field to no
log  [Current Task:Id], [Current Task:show_field], [Variable: counter]

Counter is incremented for each participant (0 for 1st, 1 for 2nd, etc).

What the log shows:

1st participant:   0, true,0
2nd participant: ###, true,1    (where ### is the task ID of the 1st participants task)
3rd participant:   0, false, 2

The 2nd log should be 0,false,1. Sometimes the 2nd log message will show ###, false,1 but the task form still acts like show_field is set to true. Sometimes the 2nd participant will log correctly and the task form looks correct. The 3rd (and following) tasks all look correct. As far as I can tell, the 2nd log has "Current Task" actually set to the "previous task", so the logging is probably invalid.

What am I doing wrong?

  • Please tag by feature or topic and not by version or product. This helps to attract more attention to your question and keep it relevant. See How do I use tags for general guidelines.
    – Alex Angas
    Commented Sep 12, 2011 at 1:26
  • +1 for unique username :D Commented Jan 31, 2012 at 10:33
  • How about using an Approval Workflow Process? Commented Apr 13, 2012 at 9:36

1 Answer 1


This feels like a race condition issue. Are you setting your counter to increase before assigning the task? If so, your workflow may be pausing, another instance runs, the counter is still 0, the first instance continues, sets the counter to 1, etc.

These issues can be tough to troubleshoot, as they're hard to repro - can you give us some more context on your workflow?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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