Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

MS Graph ODatalink paging

Hey Folks,

 

Looking for help to connect to Microsoft Graph and pull more than 999 records. Currently, below is working but not pulling all records

 

Thanks

 

 

 

(GraphURI as text) as record =>
let
    ResourceAppIdUrl = "https://graph.microsoft.com",
    OAuthUrl = "https://login.microsoftonline.com/",

    Resource = Text.Combine({"resource", Uri.EscapeDataString(ResourceAppIdUrl)}, "="),
    ClientId = Text.Combine({"client_id",ApplicationID}, "="),
    ClientSecret = Text.Combine({"client_secret", Uri.EscapeDataString(ApplicationSecret)}, "="),
    GrantType = Text.Combine({"grant_type", "client_credentials"}, "="),

    Body = Text.Combine({Resource, ClientId, ClientSecret, GrantType}, "&"),

    AuthResponse= Json.Document(Web.Contents(
        OAuthUrl, 
        [
            RelativePath= Text.Combine({TenantGUID,"/oauth2/token"}),
            Content=Text.ToBinary(Body)
        ]
    )),
    AccessToken= AuthResponse[access_token],
    Bearer = Text.Combine({"Bearer", AccessToken}, " "),

    Response = Json.Document(Web.Contents(
        ResourceAppIdUrl, 
        [
            RelativePath = GraphURI,
            Headers = [#"Content-Type"="application/json", #"Authorization"=Bearer]
        ]
    ))
in
    Response

 

 

 

 

1 REPLY 1
ams1
Responsive Resident
Responsive Resident

Hi,

 

The results are paged.

 

From https://learn.microsoft.com/en-us/graph/paging

If the result contains more results, Microsoft Graph will return an @odata.nextLink property...

 

If you look at the request response, you should see the next link there and you can use it to request the next page

I recently answered a question related to paging:

 

If this answer helped, please consider marking it as a solution.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors