Update Multi-lookup field in SharePoint 2013 Workflow
I was developing a SharePoint 2013 workflow using Visual Studio (SharePoint add-in) and I got following error while creating/updating list item with multi-lookup column.
An unexpected 'PrimitiveValue' node was found when reading from the JSON reader. A 'StartObject' node was expected.
I searched a lot but unfortunately I could not able to find solution anywhere. Then I remembered that SharePoint 2013 Workflow communicate with list using Rest API and I found how the API expects value for multi-lookup field.
http://www.jrjlee.com/2015/01/custom-workflow-activity-for-setting.html
Finally I was able to build results string as below. I have created a variable called vCollLookup and the variable type is DynamicValue.
Click on View properties, provide value for results array.
Behind the scenes the workflow sends this dynamic value in below format.
{"results":[LookupIdVal1,LookupIdVal2] }
Finally, I have used this dynamic value in UpdateListItem activity as below.
Hope it will help others.
An unexpected 'PrimitiveValue' node was found when reading from the JSON reader. A 'StartObject' node was expected.
I searched a lot but unfortunately I could not able to find solution anywhere. Then I remembered that SharePoint 2013 Workflow communicate with list using Rest API and I found how the API expects value for multi-lookup field.
- Single Lookup value format:
LookupFieldName: LookupIdVal - Mutiple Lookup value format:
LookupFieldName: {"results":[LookupIdVal1,LookupIdVal2] }
http://www.jrjlee.com/2015/01/custom-workflow-activity-for-setting.html
Finally I was able to build results string as below. I have created a variable called vCollLookup and the variable type is DynamicValue.
Click on View properties, provide value for results array.
Behind the scenes the workflow sends this dynamic value in below format.
{"results":[LookupIdVal1,LookupIdVal2] }
Finally, I have used this dynamic value in UpdateListItem activity as below.
Hope it will help others.



Comments
Post a Comment