Last active
February 28, 2019 13:15
-
-
Save IvanBond/5db0c69566e69fca030913c4b9d5b7eb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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