SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to build a document approval workflow for a sharepoint document library. The workflow needs to be exactly like the OOTB approval workflow with the exception that the Approvers depend on a metadata field in the document. for Example, HR documents needs to be approved by approver1 but finance documents need to be approved by approver2.

I made a copy of the OOTB approval workflow and want to customize it by adding an action to set the value of the Approvers Parameter as shown here (In the real workflow i will add a condition to set the actual value of the parameter but for now I just need to make sure this approach is working).

enter image description here

I set up the value of the Approvers Parameter as:

<d:Approvers xmlns:d=""
    <d:Stage xsi:nil="true" xmlns:xsi="" />

I keep getting the following error in the SP Logs:

    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> 
  System.NullReferenceException: Object reference not set to an instance of an object.     
  at Microsoft.Office.Workflow.Actions.StageContainer.UpdateFromString(SPWeb web, SPItemKey itemId, String assignmentString)     
  at Microsoft.Office.Workflow.Actions.OfficeTask.get_ParticipantList()     --- End of inner exception stack trace ---     
  at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)     
  at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)     
  at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)     
  at System.Workflow.ComponentModel.ActivityBindPropertyInfo.GetValue(Object obj, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)     
  at System.Reflection.PropertyInfo.GetValue(Object obj, Object[] index)     
  at System.Workflow.ComponentModel.MemberBind.<>c__DisplayClass1.<GetValue>b__0(Object sender, PathMemberInfoEventArgs eventArgs)     
  at System.Workflow.ComponentModel.PathWalker.TryWalkPropertyPath(Type rootType, String path)     
  at System.Workflow.ComponentModel.MemberBind.GetValue(MemberInfo memberInfo, Object dataContext, String path)     
  at System.Workflow.ComponentModel.ActivityBind.GetMemberValue(Object dataSourceObject, MemberInfo memberInfo, String path, Type targetType)     
  at System.Workflow.ComponentModel.ActivityBind.InternalGetRuntimeValue(Activity activity, Type targetType)     
  at System.Workflow.ComponentModel.DependencyObject.GetBoundValue(ActivityBind bind, Type targetType)     
  at System.Workflow.ComponentModel.DependencyObject.GetValueCommon(DependencyProperty dependencyProperty, PropertyMetadata metadata)     
  at Microsoft.SharePoint.WorkflowActions.CoerceActivity.get_Value()     
  at Microsoft.SharePoint.WorkflowActions.CoerceActivity.Coerce()     
  at Microsoft.SharePoint.WorkflowActions.CoerceActivity.Execute(ActivityExecutionContext provider)     
  at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext)     
  at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(Activity activity, ActivityExecutionContext executionContext)     
  at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)     
  at System.Workflow.Runtime.Scheduler.Run()    49157206-76a1-4fe0-8b74-0567086a80ff

Any idea what might be wrong?

Environment: Windows 2008 R2,SP2010 Enterprise edition.

share|improve this question
up vote 2 down vote accepted

I configured a dynamic approver by changing the "with [these users]" settings into looking up the data from the current item, as shown in step 11 here:

custom approval task assigment from item metadata user/group field

This blogpost suggests that you need to wrap the assignement XML inside an "Assignments" element when used inside a workflow:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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