1

I have a requirement where, on item creation on list A (Announcement List), a workflow is triggered in which list items in List B are created. The semicolon separated values are entered in list A Body field. eg.

Training Topic:Admin Tools;

The workflow reads these values and loops through them by indexing semicolons and stores each values in variables. Finally item in list B is created for all fields filling with values of appropriate variables. enter image description here enter image description here

Everything is working fine if I remove multi-choice column from this (Training Topic in this case). The items in list B are created and mail is sent.

But when I add the multi-choice column, the internal status of workflow gets suspended and it throws the following error:

System.ApplicationException: HTTP 400 {"error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"An unexpected 'PrimitiveValue' node was found when reading from the JSON reader. A 'StartObject' node was expected.}}}

Note: Since I'm logging at every step, I can see the correct string value is stored in the variable which is to be the value of the multi-choice field during creation. So the problem is probably not with the variable, it has something to do with the creation of multi-choice field.

1

Basically we're trying to update a MultiChoice column with comma seperated value. Below hack works for me. I don't think this would be the recommended way.

I create a template variable:
{"__metadata":{"type":"Collection(Edm.String)"},"results":[ITEMS]}

A data variable:
"Apple","Mango"

Now, we replace ITEMS with our data in template. So that the final variable, say json, becomes {"__metadata":{"type":"Collection(Edm.String)"},"results":["Apple","Mango"]}


Update list item multichoice column with Json variable. We're done! enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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