Skip to content

Instantly share code, notes, and snippets.

@whitemx
Created April 23, 2015 09:38
Show Gist options
  • Save whitemx/7d98d95d07d2039b3004 to your computer and use it in GitHub Desktop.
Save whitemx/7d98d95d07d2039b3004 to your computer and use it in GitHub Desktop.
let
fnGetCollectionData = (start as number) as table =>
let
endpoint = fnGetParameter("endpoint"),
count = fnGetParameter("count"),
start = start - 1,
apikey = fnGetParameter("apikey"),
Source = Json.Document(Web.Contents(endpoint,
[
Query=[
#"start"=Number.ToText(Value.FromText(start) * Value.FromText(count)),
#"count"=Number.ToText(count),
#"apikey"=apikey
]
]
)),
resultsobject = Source[data],
totalrows = Source[count],
resultstable = Table.FromRecords(resultsobject)
in
resultstable
in
fnGetCollectionData
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment