1

I'm trying to set the value of a field in a lookup column using a SPD 2013 workflow. The column is set to allow multiple values in the lookup.

I've seen many sources stating that the syntax for achieving this is either id1;#;#id2;#;#id3 or id1;#value1;#id2;#value2;#id3;#value3, where id and value are the ID of the list item and the value from the lookup field respectively. However, people are usually referring to SPD 2010 workflows, and this post suggests that this syntax cannot be used in 2013 workflows.

I want to use a native SPD 2013 workflow but when I tried the methods above they both fail with the following error:

"An unexpected 'PrimitiveValue' node was found when reading from the JSON reader. A 'StartObject' node was expected."

From this I assumed that I should be providing some kind of JSON object of the form {"results":[id1,id2,id3]} or {"results":[{"Id":id1,"Value":value1"},{"Id":id2,"Value":value2},{"Id":id3,"Value":value3}]}, which is what you get if you retrieve an existing field as a string. I attempted to build a dictionary with some test values, but I still got the same error.

Am I heading in the right direction here? Is this even possible with SPD 2013 workflows? I'd appreciate any advice on this subject.

Thanks, Jon

1 Answer 1

2

I was looking to accomplish the same thing recently. I tried similar methods as you with the old/new 2010/2013 multi-value lookup syntax as well as trying to pass through a JSON object/dictionary item. I posted a thread over at MS (https://social.msdn.microsoft.com/Forums/office/en-US/b838bd28-3dea-4137-a3ea-f8939f6281b4/updating-multivalue-lookup-fields-sharepoint-designer-2013-workflows), and while I didn't get any assistance, I did eventually find a solution.

Essentially, "Method 1" from my post should be the solution you're looking for. To recap that here (I'm not up-to-date on posting rules here): Multi-value lookup fields can't be updated in a 2013 workflow and so you need to call a 2010 workflow and pass it the parameters needed to update the multi-value lookup field.

Now in my case, I had an extra snag where this method was failing for me on certain document library items using the new 2013 syntax of ID1;#;#ID2;#;#ID3. This works for list items just fine, as well as certain file types, but seems to fail on various Office file types (Word/Excel for sure, didn't test others). The solution there was to just use the old 2010 syntax - ID1;#Value1;#ID2;#Value2;#ID3;#Value3.

Unfortunately, it feels like a huge step back from 2010. I don't think 2010 workflows (in Designer 2013) can even successfully pull multi-value lookup fields, so even in the simplest case, you have to use a 2013 workflow to fetch the field values and then parse them out to build the correct syntax before passing them through to a 2010 workflow to update.

It's such a huge step backwards, I'm sitting here wondering if I just dove too far off the deep end to see that I'm massively over-complicating things now. Regardless, hope that helps.

Jordan

1
  • Thank you! The "new 2013 syntax" helped me to create a replacement "Predecessors" field in NewForm and EditForm on a very large list. Jul 12, 2016 at 22:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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