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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi everyone,
I need a little help, please. I have access to API data:
I'm using the following code to retrieve API data:
let iterations = 10,
url = "https://graph.facebook.com/v2.10/[ACCOUNT ID]/insights?access_token=[ACCESS TOKEN]",
FnGetOnePage =
(url) as record =>
let
Source = Json.Document(Web.Contents(url)),
data = try Source[data] otherwise null,
next = try Source[paging][next] 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])
in
GeneratedListNow I'm trying to retrieve this API data:
What changes do I need to make to the original code for this? Any help, suggestion or guidance is much appreciated!
Many thanks,
Tanim
Solved! Go to Solution.
Fixed it by copy and pasting the last line from the new API data, it basically got rid of the extra "client_pages" bit and working like a charm. Looks like self help is the best help!
Fixed it by copy and pasting the last line from the new API data, it basically got rid of the extra "client_pages" bit and working like a charm. Looks like self help is the best help!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 1 |
| User | Count |
|---|---|
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 3 |