4

I'm developing a SharePoint-hosted App with a workflow working with a List that contains a UserMulti Field. I'm currently trying to retrieve this field value to a variable with a GetDynamicValueProperties but this isn't working, the workflow execution is hanging.

My workflow configuration is OK since I can retrieve the Title to a string variable for example but when I try to get the USerMulti Field (called 'Members') to a Object variable, nothing happen.

After setting up my environment to catch the HTTP traffic I was able to find something in the XML conversation :

<WorkflowStatusDetails>RequestorId: d05baf50-adbc-6aa7-0000-000000000000. Details: RequestorId: d05baf50-adbc-6aa7-0000-000000000000. Details: An unhandled exception occurred during the execution of the workflow instance. Exception details: System.InvalidOperationException: Looking up a value using a key is not supported on an instance of 'Microsoft.Activities.Dynamic.DynamicJsonPrimitive'.
  at Microsoft.Activities.Dynamic.DynamicItem.TryGetValue(String key, DynamicItem& value)
  at Microsoft.Activities.Dynamic.DynamicValueBuilder.PathSegmentFactory.ObjectPathSegment.Get(DynamicItem obj)
  at Microsoft.Activities.Dynamic.DynamicValueBuilder.PathSegmentFactory.ObjectPathSegment.Get(DynamicItem obj)
  at Microsoft.Activities.Dynamic.DynamicValueBuilder.PathSegmentFactory.ArrayPathSegment.Get(DynamicItem obj)
  at Microsoft.Activities.Dynamic.DynamicValueBuilder.PathSegmentFactory.ObjectPathSegment.Get(DynamicItem obj)
  at Microsoft.Activities.Dynamic.DynamicValueBuilder.PathSegmentFactory.ObjectPathSegment.Get(DynamicItem obj)
  at Microsoft.Activities.GetODataProperties.Execute(CodeActivityContext context)
  at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
  at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)</WorkflowStatusDetails>

Can somebody enlighten me on that error or how to properly use a UserMulti Field in a Workflow ?

Thanks and regards.

1 Answer 1

3
  1. When you get value from user field, use it's name + "Id", in your case - MembersId.
  2. Get your MultyUser field value to a DynamicValue variable (members). enter image description here
  3. Use GetDynamicValueProperties tool with your DynamicValue variable (members) as a source to get it's results to a Collection<String> variable (membersIds). enter image description here
  4. Then you can retrieve your Collection<String> variable with a simple indexation. enter image description here
2
  • Hi, how did you learn this information? I can't find ANY documentation at all!!
    – David
    Commented Jul 14, 2014 at 12:46
  • Hi, I've found it by research, by trial and error method :) There is really lack of documentation about SP Workflow 2013...
    – alisa
    Commented Jul 18, 2014 at 8:58

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.