Forum Discussion

Zack92's avatar
Zack92
Helper III
1 year ago
Solved

Need Help with Microsoft Graph API Pagination in Power Query

Hi everyone, I need some help with Microsoft Graph API pagination in Power Query. I'm pulling data for each user, but it doesn’t seem like I’m getting all the events. I think the pagination isn’...
  • v-nmadadi-msft's avatar
    1 year ago

    Hi Zack92   ,

    Thank you for reaching out to Microsoft community support,

    It seems like pagination is  not handled properly.
    The API response includes an @odata.nextLink property when there are more items to fetch beyond the initial page.
    If your code does not correctly use @odata.nextLink to retrieve subsequent pages, you'll only get the first 30 results.
    In your current code, the logic for fetching subsequent pages via GetALLpages might not be working as intended, resulting in only the first page being retrieved.

    This documentation may help you in your error

    Paging Microsoft Graph data in your app - Microsoft Graph | Microsoft Learn

     

    If the issue persists, consider using Power Automate (formerly Flow) to retrieve data with Graph API pagination and save it to a file or data source that Power Query can access. Power Automate handles pagination more seamlessly.

     

    Please consider Accepting the solution if the provided answer meets your requirement so as to help other users or get back to us if you have further queries.



    Thanks and Regards