
Hi,
You’re PATCHing the DriveItem URL with .../drives/{driveId}/items/{itemId} and a fields body. Custom columns (including lookup) must be updated on the ListItem fields endpoint, not the DriveItem. Also, SharePoint lookup columns require the <InternalName>LookupId property (ID of the referenced item). [learn.microsoft.com], [learn.microsoft.com]
Fix (Graph):
GET /sites/{site-id}/drive/items/{item-id}?$expand=listItem
→ listItem.id
Then update fields:
PATCH /sites/{site-id}/lists/{list-id}/items/{listItemId}/fields
Content-Type: application/json
{
"DemandeIdLookupId": Gallery1.Selected.ID
}
For multi‑lookup:
{
"DemandeIdLookupId@odata.type": "Collection(Edm.Int32)",
"DemandeIdLookupId": [1,2]
}
(Use the column’s internal name; single-value uses one integer, multi-value uses an array.) [stackoverflow.com], [stackoverflow.com], [stackoverflow.com]
Power Apps change (your formula): Replace the second call with the ListItem fields endpoint and valid JSON:
(Use the ListItem ID from uploadResult.Response.listItem.id; send JSON and Content-Type.)
Notes:
DemandeId may differ). If you want, I can tailor the exact URLs using your site, list, and drive IDs.