kevinschaich / mintable

🍃 Automate your personal finances – for free, with no ads, and no data collection.
https://kevinschaich.io/mintable/
MIT License
1.52k stars 200 forks source link

Export all transactions to single sheet #44

Closed aadupirn closed 4 years ago

aadupirn commented 4 years ago

Is there a config option to export all transactions to a single google sheet and update that sheet during future transaction retrieval?

kevinschaich commented 4 years ago

Hey @aadupirn – this isn't an option and I don't plan on supporting it in the near future.

The reason we break this up by monthly sheets is to simplify fetching transactions in batch. Each time you run Mintable, it takes your given date range, re-fetches, and then completely overwrites the content of the automated columns. This makes it such that if new transactions come up since the previous fetch, or temporary transactions get removed (a hold on a rental car, a pre-auth for a gas station, etc.), Mintable doesn't need to keep track of an internal state anywhere, we just wipe the slate clean and re-fill the sheet with the most up-to-date data.

If you put all transactions in the same sheet you'd need to manually keep track of which transactions you've seen before, de-duplicate those which have already been fetched, keep track of where each month starts and where it ends, so on and so forth. It's a lot of bookkeeping that I think overcomplicates the process. The provider and spreadsheet API should remain as simple as possible – a place to grab your data from, and then a place to dump it.

If this is an unsatisfying answer for you – you can kind of "hack this" by taking advantage of Google Sheets' function library. You can use the IMPORTRANGE function to grab stuff from other sheets and aggregate it all into another unified sheet:

=IMPORTRANGE("https://docs.google.com/spreadsheets/d/10fYhPJzABd8KlgAzxtiyFN-L_SebTvM8SaAK_wHk-Fw/edit#gid=375470922", "Template!A1:C10")

You can see this in action in the One Sheet tab in the Public Template.

aadupirn commented 4 years ago

Makes sense, Thanks for the writeup. Would you be interested in a separate config for column names in the google sheet for transaction info? I've added it in a local branch in a TRANSACTION_READABLE_COLUMNS config field.