Forum Discussion
How to use the $Skip ODATA expression in a loop?
- 5 years ago
A simpler approach is shown in this article/video - Power BI - Tales From The Front - REST APIs - YouTube
You can adapt that approach. Basically, you create a list of number that increment by 100 with List.Numbers, convert that to a table, make your number column a text column and then concatenate the number into your URL on each row. You then expand the column of "Table"s to get your result.
Pat
Your add column step is still missing the & before [Column1]. Also make sure [Column1] is type text (or convert it to text in this expression).
AddColumn = Table.AddColumn(ColumnType, "Custom", each Json.Document(Web.Contents(BaseURL, [Headers = [Authorization = "Bearer " & Token], RelativePath = Path & "?" & "$Skip=" & [Column1]])))
Pat
Sorry Pat, my bad. I did have the & between "?$Skip=" and [Column1] - Must have copied some old code accross.
I have found the answer though in that it's case sensitive and should have been "?$skip=" - A capital S caused me that much grief.
But I love your solution for paginating the results so definitely using that one going forward, thank you very much!