Hello Charles-Antoine Dolbeau,
Thank you for reaching out to Microsoft!!
For the lookup columns in SharePoint, they are stored as references to other lists, and their values are not directly included in the fields
property of list items. Instead, you need to use the LookupId property to retrieve the ID of the referenced Item.
Below steps might help you resolve the issue:
- Update your query to include the lookup column's internal name followed by
lookupId
. For example
https://graph.microsoft.com/v1.0/sites/{SITE_ID}/lists/{list_id}/items?$expand=fields&$select=id,fields,createdDateTime,lastModifiedDateTime,fields/commercialLookupId&$top=5000
- The
fields/commercialLookupId
will give you the ID of the referenced item in the look up column. - Ensure that you are using correct internal name for the look up column. You can find this in the SharePoint list settings under "Column settings".
- Ensure that the lookup column is indexed, matched the internal name and it should be accessible via Graph API.
Reference Link: https://learn.microsoft.com/en-us/answers/questions/916552/how-to-expand-lookup-field-when-listing-items
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.