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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
yasirm
Frequent Visitor

Graph API pagination

Hi,

I am trying to connect to the Graph API via Power Query and have built this logic to get all users from the /users endpoint

let
Data = let
Source = List.Generate( () => [WebCall = GetUsers()],
each Record.HasFields([WebCall], "@odata.nextLink"),
each [WebCall=Json.Document(Web.Contents([WebCall][#"@odata.nextLink"], [Headers = [Authorization = "Bearer " & Access_Token]]))],
each [WebCall]
),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
in Source
in
Data


This is working fine except that I am missing some results and the table returned is always in multiples of 100, it seems that when the odata.nextLink field is not found, the current API call response is not appended to the list. What am I missing?

Thank you for your help!

0 REPLIES 0

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

March 2024 PBI Gallery Image

Power BI Monthly Update - March 2024

Check out the March 2024 Power BI update to learn about new features.