Using the SharePoint HTTP flow action to update a person or group field, I kept getting this error:A 'PrimitiveValue' node with non-null value was found when trying to read the value of a navigation property; however, a 'StartArray' node, a 'StartObject' node, or a 'PrimitiveValue' node with null value was expected.
The field I was attempting to update is named Submitted By, with an internal name of Submitted_x0020_By. Each time I tried to update the field I was seeing the error noted above. It wasn’t until I looked at one of my previous flow runs did I notice what the issue was. It turns out, that the field name I should be using is Submitted_x0020_ById.
Update flow:
How do you update a Person field if the field allows for multiple selections? The example below will update the field with two different user values, but clearly, this could be extended to be more dynamic.
body('Send_an_HTTP_request_to_SharePoint_User_1')?['d']?['Id']
body('Send_an_HTTP_request_to_SharePoint_User_2')?['d']?['Id']
concat('[',outputs('Compose_1'),',',outputs('Compose_2'),']
{
"__metadata": {
"type":"SP.Data.AssignedToListListItem"
},
"SubmittedByIDsId": {
"results": [
6,
54
]
}
}
What if ‘Submitted By’ was multiple person?
Say…
$submitted=@[3,5,6]
Then…
$body=@{
“__metadata”:{
“type”: “SP.Data.LISTNAMEItem”
},
“Submitted_x0020_ById”: @{variables(‘submitted’)}
}
}
Sadly that isn’t working…
Thoughts?
TIA
~S
Shaun, I’ve updated the post with an example that updates the field with two user values. Let me know if it helps.