I know this has been answered several times with a loop and a variable to hold page size and count, but the API I’m trying to use doesn’t have those parameters.
In my API Call:
https://someserver.somwhere.com/Api/somecompany/V1/Reports/SOMEREPORT?e1f20fb0-904c-4c26-bba6-6cfc2498254d=4624&56d00f53-07f5-4b35-8a35-64ed26c15221=GBR
I get this response as part of the JSON response (after the first 5k records of data)
The full URL that it returns includes the original + a cursor reference:
&cursor=KI0NvYKhByherD%252Fp2%252FuO%252B9BmhDUyZXQkMEsu8Jbny4l1zeTQlDT9%252Fc%252FydxoEV4GK
Which obviously is a unique value so I won’t know it until I call it (Rows could be under 5k and not have this) and changes every time I call it. I could also have to call it multiple times if the data is say 30K rows.
As it’s part of the JSON response I can isolate it as a value and call it again, but in Power Query, how do I add that data to the original source and iterate through until I no longer get the paging URL.
PowerQuery below:
GTNURL is a field in an EXCEL document (I’m parsing the original URL in that due to needing some extra parameters).
let
URLL = Excel.CurrentWorkbook(){[Name="GTNURL"]}[Content]{0}[Column1],
Source = Json.Document(Web.Contents(URLL)),
Data = Source[Data],
#"Converted to Table" = Record.ToTable(Data),
Value = #"Converted to Table"{1}[Value],
#"Converted to Table1" = Table.FromList(Value, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table1", "Column1", {"A Number of fields" })
in
#"Expanded Column1"
Anyone any ideas? Gratefully received!
1