Hello Almaany, Omar,
Thanks for reaching out!
Yes, it is possible to fetch custom columns along with file details from a SharePoint site using Microsoft Graph APIs. When retrieving file details using the Microsoft Graph API, you can include the $expand
query parameter to expand the custom columns associated with the file.
To fetch custom columns, you need to make use of the SharePoint-specific properties. Here's an example API request to retrieve file details along with custom columns:
GET https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items/{item-id}?$expand=fields
In the above request, you need to replace {site-id}
, {list-id}
, and {item-id}
with the actual IDs for your SharePoint site, list, and item respectively. The $expand=fields
query parameter is used to include the custom column values associated with the item.
The response will include the custom column values in the fields
property of the item. Each custom column will have its own property within the fields
object.
Make sure that you have the necessary permissions to access the SharePoint site and retrieve custom column data. Additionally, ensure that the custom columns are associated with the list and the items have values for those columns.
By including the $expand=fields
query parameter, you should be able to fetch custom columns along with file details from a SharePoint site using Microsoft Graph APIs.
Hope this helps.
If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.