I'm trying to assign the value of column AssignedTo to multiple people, using data being read from another list with the same. I currently have this working with Create Item action, which requires hard-coding the Site / List name, and am trying to transition to using a generic HTTP request action to get around this. For all other fields this works fine, but when I try to set AssignedTo, I just can't find the right structure, or any way to inspect the working Create Item POST body so that I can compare.
For the Create Item action, I construct an array into a variable such as:
[
{"Claims": "i:0#.f|membership|me@company.com.au"},
{"Claims": "i:0#.f|membership|other@company.com.au"}
]
And that goes into the AssignedTo field in Create Item form, and it just works.
Now I set my new composed body for HTTP request to e.g.
{
"Title": "@{variables('DocumentPath')}:@{items('Each_Stage')['RunOrder']}",
"AssignedTo": @{variables('Claims')}
}
using the exact same array, and the HTTP POST returns: Value cannot be null. Parameter name: entitySet
Removing AssignedTo and creating with just Title only works.
I believe that for multi-fields in general you need to wrap this into an object such as:
"AssignedTo": {"results": @{variables('Claims')}}
So I've tried that but that just gives a different error A node of type 'StartObject' was read from the JSON reader when trying to read the contents of an entity set reference navigation link; however, a 'StartArray' node was expected.
I take that to mean it wants an array directly rather than this "results" object.
I've also tried both combinations but with the key "AssignedToId" instead of "AssignedTo", and both give errors:
* With array: 'StartObject' node was found ... A 'PrimitiveValue' node was expected.
* With object {"results": .. }: 'StartObject' node was found ... A 'StartArray' node was expected.
What am I missing here? I really want to avoid doing additional lookups of user data if it can be avoided, and clearly the "Claims" data should be authoritative and usable as it is, I just can't find the right way to express it in this request.