Skip to content

Instantly share code, notes, and snippets.

@katoen
Created May 25, 2020 20:06
Show Gist options
  • Select an option

  • Save katoen/62e49159033c5d8078605387d8f94f0f to your computer and use it in GitHub Desktop.

Select an option

Save katoen/62e49159033c5d8078605387d8f94f0f to your computer and use it in GitHub Desktop.
TOSHL Finance API Power BI - List entries
/*
List TOSHL.com transactions in Power BI Power Query
https://developer.toshl.com/docs/entries/list/
all KEYS & IDs stored as parameters
*/
let
Source = Json.Document(
Web.Contents(
"https://api.toshl.com/entries?from=2000-01-01&to=2020-05-31", 
[Headers = [#"Content-Type" = "application/json", accept = "application/json", Authorization
= "Bearer " & TOSHLAPIKEY]]
)
),
#"Converted to Table" = Table.FromList(
Source, 
Splitter.SplitByNothing(), 
null, 
null, 
ExtraValues.Error
),
#"Expanded Column1" = Table.ExpandRecordColumn(
#"Converted to Table", 
"Column1", 
{
"id", 
"amount", 
"currency", 
"date", 
"desc", 
"account", 
"category", 
"created", 
"modified", 
"completed", 
"deleted", 
"tags", 
"import", 
"readonly"
}, 
{
"id", 
"amount", 
"currency", 
"date", 
"desc", 
"account", 
"category", 
"created", 
"modified", 
"completed", 
"deleted", 
"tags", 
"import", 
"readonly"
}
)
in
#"Expanded Column1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment