TutorialEnglish

Automate Daily Expense Tracking on iPhone with Shortcuts & Google Sheets

⏱️ 6 min read👁️ 0 views
Automate Daily Expense Tracking on iPhone with Shortcuts & Google Sheets

A Little Story Before the Tech Talk

I still remember the night I was scrolling through my bank app, squinting at a $73 coffee latte I didn't even recall buying. My gut said, "That can't be right," but I had no record of it. The next morning, I told my roommate Maya, "If only I could log every purchase the moment it happened, I wouldn't be guessing all the time." That off‑hand complaint sparked a tiny experiment: could my iPhone automatically write each expense into a Google Sheet? After a few false starts and a lot of coffee, I finally built a workflow that runs itself every night. If you’re fed up with manual spreadsheets or clunky budgeting apps, stick around – I’m sharing exactly how I did it.

Why I Chose Shortcuts + Google Sheets

I could have bought a premium budgeting app, but I wanted a solution that stays in my existing ecosystem, costs nothing, and gives me raw data I can tinker with. Shortcuts (Apple’s native automation app) runs locally on the phone, so there’s no extra subscription. Google Sheets is cloud‑based, free, and plays nicely with CSV imports. Together they form a lightweight, transparent pipeline: capture → send → store. No hidden fees, no vendor lock‑in, and you keep full control over your numbers.

Setting Up the Google Sheet

1. Create a simple spreadsheet

Open Google Drive, hit New → Google Sheets, and name it Daily Expenses. In row 1 add headings: Date, Category, Amount, Notes. That’s all you need for a functional log.

2. Prepare the sheet for API writes

Click Share, set the sharing option to Anyone with the link can edit (you can tighten this later). Copy the sheet’s URL – you’ll need the spreadsheetId, which is the long string between /d/ and /edit.

3. Get a Google Apps Script web app (optional but handy)

If you’re comfortable with a tiny bit of code, open Extensions → Apps Script, paste the following function, and deploy it as a Web App with Anyone, even anonymous access:

function doPost(e){
  const ss = SpreadsheetApp.openById('YOUR_SPREADSHEET_ID');
  const sheet = ss.getSheetByName('Sheet1');
  const data = JSON.parse(e.postData.contents);
  sheet.appendRow([data.date, data.category, data.amount, data.notes]);
  return ContentService.createTextOutput('OK');
}

Replace YOUR_SPREADSHEET_ID with the ID you copied earlier. Save and Deploy – you’ll receive a URL that accepts POST requests. This script lets the Shortcut push a JSON payload directly to your sheet without dealing with OAuth.

Building the Shortcut

Below is the numbered step‑by‑step guide you can copy into the Shortcuts app. Open Shortcuts, tap +, then Add Action as instructed.

  1. Ask for Input – Set the prompt to "Enter amount (e.g., 12.99)" and the input type to Number.
  2. Ask for Input – Prompt "Category (Food, Transport, etc.)" with Text type.
  3. Ask for Input – Prompt "Notes (optional)" with Text type, leave Allow Empty on.
  4. Get Current Date – Use Current Date action, then format it as yyyy‑MM‑dd.
  5. Combine into Dictionary – Add a Dictionary action with keys date, category, amount, notes, linking each to the previous actions.
  6. Get Contents of URL – Set method to POST, URL to the web‑app endpoint you deployed, and request body to JSON using the dictionary from step 5.
  7. Show Result – Add a Show Notification action that says "Expense logged! 🎉" – optional but satisfying.
  8. Save Shortcut – Name it Log Expense and add it to your Home Screen for quick access.

Testing the Shortcut

Run the shortcut, fill in the fields, and then open your Google Sheet. You should see a new row appear instantly. If nothing shows up, double‑check the web‑app URL and make sure the script was deployed with the correct access level.

Tip: If you prefer not to use a web app, you can send the CSV line to a mailto: address that feeds into a Zapier or IFTTT automation. The web‑app method is the cleanest because it eliminates third‑party services.

Automating the Daily Capture

Now that the manual shortcut works, let’s make it run without you lifting a finger each night.

1. Create an Automation

Open Shortcuts, go to the Automation tab, tap Create Personal Automation, and choose Time of Day. Set the time to something like 10:00 PM – after dinner, when you’re likely to have spent money.

2. Add the Run Shortcut action

Select the Log Expense shortcut you saved earlier. This tells iOS to launch the shortcut at the specified hour.

3. Pre‑fill the prompt with a default value (optional)

If you keep a running mental tally of your day's spend, you can add a Text action before the Run Shortcut that feeds a variable into the Ask for Input actions. For instance, a quick note in your phone’s Notes app could be parsed and inserted.

4. Enable the automation

Toggle Ask Before Running to Off – you don’t want a popup every night. Confirm, and you’re set.

Adding a Friendly Reminder

Even the most automated system benefits from a human nudge. Add another action Show Notification after the Run Shortcut action: "Your daily expense log is up to date. 🎈" You’ll get a quiet ping on your lock screen, confirming the job is done.

FAQ

Q: Do I need a Mac to deploy the Google Apps Script? A: No. You can edit and deploy the script directly from the Google Sheets web UI on any computer or even on your iPhone’s browser.

Q: What if I want multiple sheets for different months? A: Include a month‑based tab name in the script (e.g., getSheetByName(new Date().toLocaleString('en-US', {month: 'short'}))). Or simply duplicate the sheet each month and point the shortcut to the new ID.

Q: Is my financial data safe with this setup? A: The data lives in your Google Drive, which is protected by Google’s standard security. The web‑app is public only in the sense that it accepts POST requests; it does not expose your sheet to view‑only URLs. If you’re extra cautious, lock the web‑app to Only myself and use an OAuth token – that requires a bit more setup but adds a layer of authentication.

A Warm Wrap‑Up

When I first tried to automate my expense tracking, I feared I’d end up with a broken script and a pile of unsent data. After a few tweaks, the system now runs like clockwork, and I barely notice it. The best part? I can glance at my Google Sheet any morning and see a clear picture of yesterday’s spending without the mental gymnastics of recalling every coffee, subway ticket, or impulse snack. If you give this a try and run into a snag, drop a comment or shoot me a DM. I love hearing how others customize the flow – whether you add categories for “Pet Supplies” or integrate a quick‑look at your bank balance. Happy automating, and may your budget stay as tidy as your shortcut library!

RT

By the ReadyTips Team

We research, test, and write practical guides so you don't have to figure things out the hard way. Every article is reviewed by hand before publishing.

Share this article:

You Might Also Like