Last active
May 2, 2022 19:58
-
-
Save nonsocchi/3fcb9624bc6fadcb8116229b339dd86a to your computer and use it in GitHub Desktop.
This file contains 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
// SAVE DATA TO GOOGLE SHEETS | |
function saveToSheet(txnData){ | |
// Replace url with your own url link. | |
var expenseSpreadsheet = SpreadsheetApp.openByUrl("https://docs.google.com/spreadsheets/d/1VZBkiqoTmcnWcxvNCEgHwMLhy_sBof4Cbd0gmKvkxOk/edit#gid=0"); | |
var dataSheet = expenseSpreadsheet.getSheetByName("Data"); | |
Logger.log('Populating spreadsheet...'); | |
for (var txn = 0; txn < txnData.length; txn++) { | |
dataSheet.appendRow([ | |
txnData[txn].txnDate, | |
txnData[txn].txnAmount, | |
txnData[txn].txnDesc, | |
txnData[txn].txnType, | |
txnData[txn].balance, | |
txnData[txn].txnAccount | |
] | |
); | |
} | |
} | |
function processTxnEmails() { | |
var messages = getBankEmails(); | |
var txnData = parseMessageBody(messages); | |
saveToSheet(txnData); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment