- Thoughts By Adel
- Posts
- How I automated expense tracking with zero code
How I automated expense tracking with zero code
INSIDE: No-Code Tools, OpenAI Integration, Budget Tracker
You probably don’t know this about me. But I’m spoiled as fuck.
Well, actually, it’s mostly because I hate wasting time. I like spending my time on things that bring me joy. There’s a reason why I prefer buying ready-made meals and hiring cleaners.
And this also applies to expense tracking. In this newsletter, you’ll learn more about how I completely automated this part of my finances… without writing a single line of code… and without spending any money!
But before that, let’s rewind the clock.
Budget Tracking History
Believe it or not, I’ve been tracking my expenses every single day for almost 5 years!
It all started when I discovered the tool, YNAB. Unlike in a traditional budgeting tool, the spending limits you set in each category have NO relationship to the money you have right now. With YNAB, you take your current money, and use it to set your spending limits. Even better, if you go over the limit, you have no choice but to cover it from another category. No hypothetical budgets. All real money.
On top of that, YNAB offers the option to connect with your bank, enabling automatic real-time transaction imports! However, there was a problem: YNAB did not support any banks from the Philippines. Essentially, I was paying a premium for nothing more than a glorified spreadsheet.
That was when I decided to move to the literal spreadsheet version of YNAB, called Aspire Budget. Since it was open-source, I paid nothing for it! I have absolutely loved using this tool ever since.
All was well, until I moved to Australia. The amount of transactions I tracked on a daily basis doubled. It was becoming more and more tedious! Something definitely had to change.
Building the Thing
I write code for a living. But, I always avoid writing code after work hours.
So, I challenged myself: How can I automate expense tracking without writing a single line of code and without spending a dime. In essence, how do I make YNAB completely obsolete (for me at least).
Here's what I came up with:
Let's unpack some of those components.
Component #1: Up Bank
The bank I'm currently using is called Up. Luckily, they are as developer-friendly as you can get. They provide customers an API so that we can access our personal banking data programmatically. They also have webhooks, which will allow me to receive a real-time event from Up. And, you've guessed it, this event will contain all of the details about the transaction details real-time!
If you're interested in exploring other APIs offered by Up, check out this guide.
Component #2: Make.com
Okay, listen up, non-coders. If you want to build cool stuff or automate anything annoying in your life, no-code platforms are perfect for you. Make.com and Zapier are the two most popular tools out there. You use these platforms to build almost anything you want without writing a single line of code. The only reason I chose Make.com over Zapier was solely for its superior freemium features!
In this project, I mainly used Make.com to write up a workflow with these 3 main instructions:
Receive transaction events from Up's webhook
Ask OpenAI's GPT what type of category the transaction should belong to
Add a new row to my Aspire Budget spreadsheet
As you can see, no lines of code! Simply drag-and-drop the components and configure what they should do.
Okay look, the components above don't really feel like a 3-step process. Well, mostly, it's because of the ff. reasons:
For every output of the non-Tools components, I had to save its value in a variable using the Tools component. Honestly, Make.com could've simplified this process to reduce number of components to draw.
The transaction event I receive from Up only contains the ID of the transaction. If I want more details, I have to ask Up using a separate API to give me more details.
I had a separate workflow for fetching my transaction categories from Aspire Budget. If I decided to add/remove categories from my spreadsheet, I don't want to manually update my workflow above. These fetched categories are automatically saved into storage, and retrievable by workflows like what I did above.
When you add a new row to Google Sheets using Make.com, it will add it to the first non-empty row of the sheet. Well, due to Aspire Budget's structure, row 1 will always be the first non-empty row of the sheet. So, I had to programmatically figure out which row number I should insert to using a separate component.
If the transaction amount is positive (inflow), then I had to insert the amount into a different column vs. when the amount is negative (outflow). That’s what the Router is for.
If you're keen on delving deeper into each of these components, don't hesitate to reach out with any questions on LinkedIn.
Component #3: OpenAI's GPT
You might be asking, why the heck do we need OpenAI's GPT in our workflow?
Well, Up automatically categorizes transactions based on its own set of categories. Pretty neat! Problem is, I also have a different set of categories for my own transactions. How do we solve this?
Just ask ChatGPT. It excels with this kind of thing. The prompt is extremely simple too:
You are an expert in categorizing financial transactions. You are tasked to categorize a financial transaction using the following steps below:
1. Receive the name and description tied to the transaction
2. Categorize the transaction into the following categories: "{{MY OWN CATEGORIES LIST}}"
3. If you are highly unsure about the answer, please output "Available to budget" as the result of this prompt
4. Please only output the one or two-word Category as the result of this prompt, nothing else
The input given to you is the following:
- Name: {{TXN NAME FROM UP}}
- Description: {{TXN CATEGORY FROM UP}}
It's not perfect. But it does get it right 95% of the time. Not bad!
Retrospective
I activated the workflow last Thursday via Make.com, and it's still going strong! It hasn't missed a single transaction yet. This is going to save me so much time!
Oh, and did I forget, everything is completely free! How Make.com and OpenAI makes money is through power users. Completely based on their usage. Luckily, my “simple” lifestyle keeps my usage minimal for both Make.com and OpenAI in this expense tracking automation.
Overall, this was an absolute win for me 🏆
Stay tuned for more complex projects in the future. Possibly, with more AI!
Oh, and one more thing. If you’re enjoying this, can you do me a favor and forward it to a friend? Thanks.