Created
May 25, 2020 19:01
-
-
Save katoen/e41618b9b5e4e5889f8a9f47858417a1 to your computer and use it in GitHub Desktop.
YNAB API Power BI - GET Transactions
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
/* | |
GET YNAB.com transactions in Power BI Power Query | |
https://api.youneedabudget.com/v1#/Transactions/getTransactions | |
all KEYS & IDs stored as parameters | |
*/ | |
let | |
Source = Json.Document( | |
Web.Contents( | |
"https://api.youneedabudget.com/v1/budgets/" & YNABBudgetID & "/transactions", | |
[Headers = [#"Content-Type" = "application/json", accept = "application/json", Authorization | |
= "Bearer " & YNABAPIKEYTRANS]] | |
) | |
), | |
data = Source[data], | |
transactions = data[transactions], | |
#"Converted to Table" = Table.FromList( | |
transactions, | |
Splitter.SplitByNothing(), | |
null, | |
null, | |
ExtraValues.Error | |
), | |
#"Expanded Column1" = Table.ExpandRecordColumn( | |
#"Converted to Table", | |
"Column1", | |
{ | |
"id", | |
"date", | |
"amount", | |
"memo", | |
"cleared", | |
"approved", | |
"flag_color", | |
"account_id", | |
"account_name", | |
"payee_id", | |
"payee_name", | |
"category_id", | |
"category_name", | |
"transfer_account_id", | |
"transfer_transaction_id", | |
"matched_transaction_id", | |
"import_id", | |
"deleted", | |
"subtransactions" | |
}, | |
{ | |
"id", | |
"date", | |
"amount", | |
"memo", | |
"cleared", | |
"approved", | |
"flag_color", | |
"account_id", | |
"account_name", | |
"payee_id", | |
"payee_name", | |
"category_id", | |
"category_name", | |
"transfer_account_id", | |
"transfer_transaction_id", | |
"matched_transaction_id", | |
"import_id", | |
"deleted", | |
"subtransactions" | |
} | |
) | |
in | |
#"Expanded Column1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment