Skip to content

Instantly share code, notes, and snippets.

@IvanBond
Last active February 28, 2019 13:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IvanBond/5db0c69566e69fca030913c4b9d5b7eb to your computer and use it in GitHub Desktop.
Save IvanBond/5db0c69566e69fca030913c4b9d5b7eb to your computer and use it in GitHub Desktop.
(url as text) as table =>
let
response = Web.Contents(url, [Headers=[Authorization=#"Authorization"]]),
body = Json.Document(response),
moreavailable = try Logical.From( body[more_available] ) otherwise false,
users = body[users],
#"Converted to Table" = Table.FromList(users, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1",
{"id", "state", "full_name", "job_title", "mugshot_url", "web_url", "activated_at", "stats", "email"},
{"id", "state", "full_name", "job_title", "mugshot_url", "web_url", "activated_at", "stats", "email"}),
#"Expanded stats" = Table.ExpandRecordColumn(#"Expanded Column1", "stats", {"following", "followers"}, {"following", "followers"})
in
#"Expanded stats" meta [ MoreAvailable = moreavailable ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment