Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi all
I have some M Code which works perfectly fine for 1 REST API provider (So I get all the pages perfectly fine in to one list).
Looking at another provider and the JSON is slightly different but still contains the Next Page URL. So adjusted my M function to reflect the JSON but now I only get the first page and no further. I know this all works so this has to be something to do with the structure of the JSON or something with the Next Page URL..
The M code is this:
let
Source = List.Generate( () =>
[URL = "/Students/?options=includePhotos%2CincludeGroupIds%2CincludeGroupIdaasIds%2CincludeGroupXIDs%2CincludeLeavers%2CincludeSubsidiary%2CincludeComms&page=1&pageSize=25",
Result = Json.Document(Web.Contents("https://xporter.groupcall.com/api/v1/School/3281102",[RelativePath=(URL),Headers=[Authorization="********************"]]))],
each [URL] <> null,
each [
URL = [Result][__pagination__][NextPage],
Result = Json.Document(Web.Contents("https://xporter.groupcall.com/api/v1/School/3281102/Students/",[RelativePath=(URL),Headers=[Authorization="********************* "]]))
]
)
in
Source
The JSON I'm now trying to work with is the below structure:
Can anyone shed any light on why this code now won't paginate please?
You may want to clean up your RelativePath variable, and separate the Query parameters into their own section.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
143 | |
74 | |
63 | |
51 | |
47 |
User | Count |
---|---|
211 | |
85 | |
64 | |
59 | |
56 |