Share via

How to get custom fields from SharePoint using the /pages endpoint

2026-02-17T13:06:23.9066667+00:00

Currently we retrieve news items using the /pages endpoint. On our test site we added a custom field which we would like to display or filter on, but custom fields are not available in the results. Is there a possibility to get the values of custom fields or filter on them using the /pages endpoint?

This is how we use it now:
https://graph.microsoft.com/v1.0/sites/pages/microsoft.graph.sitePage?$expand=webParts&$filter=promotionKind%20eq%20'newsPost'&$top=8&$orderby=lastModifiedDateTime%20desc

Microsoft 365 and Office | SharePoint | Development
0 comments No comments

Answer accepted by question author

  1. Jayden-P 21,480 Reputation points Microsoft External Staff Moderator
    2026-02-17T14:04:46.67+00:00

    Hi @Roel Plieger (Bossers & Cnossen BV)

    Thank you for posting question to Microsoft Q&A forum.

    Based on my research, custom columns added to the Site Pages is not part of the sitePage schema and therefore it will not return in the response.

    sitePage resource type - Microsoft Graph v1.0 | Microsoft Learn

    In conclusion, the /pages (or /pages/microsoft.graph.sitePage) endpoint does not support filtering on custom site/library columns (fields) added to the Site Pages library.

    If getting custom fields is crucial, you can change your approach by query the site pages list directly. List items - Microsoft Graph v1.0 | Microsoft Learn

    First, get the Site Pages list ID:

    GET https://graph.microsoft.com/v1.0/sites/{site-id}/lists?$filter=displayName eq 'Site Pages'&$select=id,displayName 
    

    Query items with custom fields:

    GET https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{page-list-id}/
    

    I hope this information helps.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.