I\'m looking for a way how to update a lookup field and a user field with Microsoft graph ? I can read the item, but I don\'t find a way to create or update this kind of field e
Nowadays it is supported to update lookup fields via Microsoft Graph API.
Lets say there is a field named Category
, then depending whether lookup field is represented as single or multi valued, the following examples demonstrate how to set lookup field value.
for single-valued field:
Url: https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items/{item-id}/fields
Method: PATCH
Body: {
"CategoryLookupId": "1"
}
where
field name
is provided in the following format: {field-name}LookupId
field value
corresponds to lookup id and provided as a stringfor multi-valued field
Url: https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items/{item-id}/fields
Method: PATCH
{
"CategoryLookupId@odata.type": "Collection(Edm.String)",
"CategoryLookupId":["1","2"]
}