Skip to content

iOS Shortcuts Setup — Finance Tracker

This document covers the step-by-step setup of the consolidated iOS shortcuts used in the Finance Tracker system. By using a single "Core Processor" shortcut, you only need to configure your Web App URL and JSON payload once.

Prerequisites before starting:

  • Apps Script Web App deployed and URL copied
  • Google Account signed into iPhone
  • iOS 16 or later

Architecture Overview

Instead of maintaining the POST URL and JSON configuration in three separate shortcuts, you create one "Core Processor" shortcut that handles the processing, and use iOS triggers to pass data to it.

mermaid
flowchart LR
    A["SMS Automation\n(automatic)"] -->|Pass Text| Core
    B["Share Sheet\n(manual)"] -->|Pass Image| Core
    C["Home Screen Icon\n(manual)"] -->|Run with No Input| Core
    Core["Core Processor:\n'Upload Finance Entry'"] -->|Base64 & POST| W["Web App"]
    W --> D["Google Drive\nInbox/"]
TriggerHow it worksAction
SMS AutomationAutomaticiOS receives SMS from bank, runs Core Shortcut with text input
Share SheetManualYou share a screenshot directly to the Core Shortcut
Home ScreenManualYou launch the Core Shortcut without input; it prompts for text entry

Step 1: Create the Core Processor ("Upload Finance Entry")

This shortcut handles all the logic: identifying the input type (image vs text), asking for manual input if launched from the home screen, encoding the payload, and sending it to Google Drive.

  1. Open Shortcuts → +
  2. Name it: Upload Finance Entry
  3. Tap the (info) button at the bottom and enable Show in Share Sheet. Tap Done.
    • Change "Receive Any input" to Images and Text.
    • If there's no input: Continue

Action sequence

#ActionConfiguration
1IfInput: Shortcut Input · Condition: has any value
2Get TypeVariable: Shortcut Input
3IfInput: Type (from step 2) · Condition: is · Text: Image
4Set VariableType: Prefix · Value: file_
5Set VariableType: MimeType · Value: image/png
6Set VariableType: Extension · Value: .png
7Otherwise(If not an image, it must be the SMS text)
8Set VariableType: Prefix · Value: sms_
9Set VariableType: MimeType · Value: text/plain
10Set VariableType: Extension · Value: .txt
11End If
12Set VariableType: Payload · Value: Shortcut Input
13Otherwise(If no input at all, it's the Home Screen manual trigger)
14Ask for InputType: Number · Prompt: Amount? · Allow Decimal: on · Allow Negative: off
15Ask for InputType: Text · Prompt: Details? · Default Answer: (expense)
16TextSee text block configuration below
17Set VariableType: Prefix · Value: input_
18Set VariableType: MimeType · Value: text/plain
19Set VariableType: Extension · Value: .txt
20Set VariableType: Payload · Value: Text (from step 16)
21End If
22Ask for InputType: Number · Prompt: Split by how many? · Default: 1
23EncodeInput: Payload (from step 12 or 20) · Encoding: Base64 · Line Breaks: Every 76 Characters
24Format DateDate: Current Date · Format: Custom → yyyy-MM-dd_HHmmss
25Get Contents of URLSee POST configuration below

Text block configuration (step 16)

Tap the Text action and type exactly:

New spending on [Current Date]
Amount $[Amount]
Details: [Details]

Where:

  • [Current Date] — insert the Current Date variable
  • [Amount] — insert the Provided Input variable from step 14
  • [Details] — insert the Provided Input variable from step 15

POST configuration (step 25)

SettingValue
URLYour Web App URL
MethodPOST
Headers(none)
Request BodyJSON
JSON keyValue
filenameType: text → [Prefix][Formatted Date][Extension]
mimeTypeType: plain text → [MimeType]
dataVariable: Base64 Encoded (result of step 23)
splitByVariable: Provided Input (result of step 22 — the split number)

Important Note on JSON fields: When configuring mimeType, make sure it is parsed as a string containing variables, NOT a single Blue Pill. Type out any missing text if needed, then place the [MimeType] variable. Ensure the same for filename.


Step 2: Configure the Triggers

Now that the Core Processor is built, you just configure iOS to send data to it. You don't need to create separate processing shortcuts anymore!

Trigger A — SMS Automation (Automatic)

This automatically runs when a matching SMS arrives and sends it to your Core Processor.

  1. Open Shortcuts → Automation → +
  2. Select Message
  3. Configure:
    • From: Rogers Credit Card Transaction (add any other bank sender names)
    • Message contains: Details:
    • Run: Run Immediately (not "Ask Before Running")
  4. Action Sequence:
    1. Receive messages as input (Added automatically)
    2. Run Shortcut
      • Shortcut: Upload Finance Entry
      • Input: Shortcut Input (the SMS text)

    Note: Make sure the Dropdown for the Run Shortcut action has "Show While Running" ON, otherwise the "Split by?" prompt in the Core shortcut will fail to appear when your phone is locked.

Trigger B — Share Sheet (Manual)

Because the Core Shortcut has Show in Share Sheet enabled (configured in Step 1), it already functions as a Share Sheet trigger!

  1. Take a screenshot of a transaction.
  2. Tap Share (or open the Photos app and tap Share on any image).
  3. Select Upload Finance Entry.
    • Your Core shortcut will receive the Image, determine it's an Image in Step 3, and process it correctly! No extra shortcut needed!

Trigger C — Home Screen (Manual)

You can launch the Core shortcut directly from the Home Screen. When run from the Home Screen, Shortcut Input will be completely empty, which triggers the manual text entry block.

  1. Open Shortcuts.
  2. Find Upload Finance Entry.
  3. Tap the ... on the shortcut → Tap shortcut name at top → Add to Home Screen.
  4. When tapped from the Home Screen, the Core shortcut will hit the Otherwise block (step 13), prompting you for the Amount and Details manually.

Conclusion

By refactoring to this system, you only need to configure the Web App URL and the Base64 JSON payload in one place (Upload Finance Entry).

  • SMS texts are handled via an Automation that passes text to the shortcut.
  • Screenshots are directly passed to the shortcut via the Share Sheet.
  • Manual entries are initiated by opening the shortcut from the Home Screen without any input.