I'm trying to update a multi-value lookup field in a SharePoint 2013 list from a SharePoint designer workflow using the 'Call HTTP Web Service' action.
Here's how the field looks when querying a list item with two values:
"Assigned_x0020_toId":{"__metadata":{"type":"Collection(Edm.Int32)"},"results":[1,2]}
I'm using nested dictionaries to create the json structure for the POST request within SharePoint Designer but I'm not sure how to create a JSON array as needed by the "results" field.
I'm reading the "Assigned to" field from another list into a workflow variable typed as "Lookup Ids, comma delimited".
I then create a dictionary with an item "results" and the value set to my comma delimited lookup ids variable.
The json this produces is:
"Assigned_x0020_toId":{"results":1}
I get the following error when executing the query:
An unexpected 'PrimitiveValue' node was found when reading from the JSON reader. A 'StartArray' node was expected.
I think that's because the query should be:
"Assigned_x0020_toId":{"results":[1]}
Can anybody help me achieve that in SharePoint designer or suggest a better alternative?
The reason I'm using the web service is that I'm trying to create a workflow that loops through all of a list's items updating values when changes are made in another list.