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

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

Reply
makpaul
New Member

Unable to get all data from the source after changing to RelativePath method

 

The following code works fine and could get all data from the source. Yet, it is unable to refresh on PowerBI web.

let
iterations = 150,
url = "https://sjc1.qualtrics.com/API/v3/mailinglists/mailing-list-id/contacts/",
FnGetOnePage = (url) =>
let
Source = Json.Document(Web.Contents(url, [Headers=[#"X-API-TOKEN"="token here"]])),
data = try Source[result][elements] otherwise null,
next = try Source[result][nextPage] otherwise null,
res = [Data=data, Next=next]
in
res,

GeneratedList =
List.Generate(
()=>[i=0, res = FnGetOnePage(url)],
each [i]<iterations and [res][Data]<>null,
each [i=[i]+1, res = FnGetOnePage([res][Next])],
each [res][Data]),
    GeneratedList1 = GeneratedList{0}
in
    GeneratedList1

 

 

I tried to change the code to use RelativePath method instead for getting source data so to see if it could be refreshed on PowerBI web but I found that it cannot obtain all the data from the source as the above method does.

 

let
iterations = 150,
url = "https://sjc1.qualtrics.com/",
FnGetOnePage = (url) =>
let
Source = Json.Document(Web.Contents(url, [RelativePath="API/v3/mailinglists/mailing-list-id/contacts/?skipToken=", Headers=[#"X-API-TOKEN"="token-here"]])),
data = try Source[result][elements] otherwise null,
next = try Source[result][nextPage] otherwise null,
res = [Data=data, Next=next]
in
res,

GeneratedList =
List.Generate(
()=>[i=0, res = FnGetOnePage(url)],
each [i]<iterations and [res][Data]<>null,
each [i=[i]+1, res = FnGetOnePage([res][Next])],
each [res][Data]),
    GeneratedList1 = GeneratedList{0}
in
    GeneratedList1

 

I would like to ask what further modification is needed to allow PowerBI to get all data from the source normally.

 

Thank you.

1 REPLY 1
Nathaniel_C
Community Champion
Community Champion

Hi @makpaul , Let us reach out to @ImkeF - she is a whiz at m language!
Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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