Untitled Note

Of course. That's an excellent project, and automating the import process is a fantastic way to stay on top of your finances. You've correctly identified that a Shortcut is the best approach for this on an iPad.


There's one important clarification before we dive in: AppleScript is a technology exclusive to macOS and does not run on iPadOS.


However, the good news is that you can achieve everything you've described using the built-in Shortcuts app on your iPad, which is arguably even more user-friendly for this task. We can build a Shortcut that will:

Ask you to pick your bank's CSV file.

Read and process the data line by line.

Let you pick which account it belongs to.

Reorder the columns as needed.

Append the new transactions to the correct table in your Numbers workbook.


Let's walk through how to set this up.


# Phase 1: Prepare Your Numbers Workbook


Before building the automation, your Numbers workbook needs to be structured correctly. A clean setup is key to a smooth import.


1. Create Your Workbook: Create a new Numbers file. Let's call it Financial Workbook.

2.  One Sheet Per Account: Create a separate sheet for each bank account (e.g., "Checking," "Savings," "Credit Card").

3.  Create a Ledger Table: On each sheet, create a table. It's crucial to give this table a specific name (e.g., "Transactions"). You can rename a table by double-tapping its name at the top.

4.  Define Column Headers: In the header row of each "Transactions" table, define your columns in the final order you want them. This is how you'll control the "sorting" of columns from the CSV. For example:

Date

Description

Category (You can fill this in manually later)

Debit

Credit


| Date | Description | Category | Debit | Credit |

| :--- | :--- | :--- | :--- | :--- |

|      |      |      |      |      |



# Phase 2: Build the Shortcut on Your iPad


Now, let's build the Shortcut that will act as our importer. Open the Shortcuts app and create a new Shortcut.


Here are the actions you will add, step-by-step.


## Step 1: Select the Input File

This action prompts you to choose the CSV file you downloaded from your bank.

Search for the Select File action and add it. You can toggle off "Select Multiple" if you plan to import one file at a time.


## Step 2: Choose the Target Account

This step makes the Shortcut flexible, allowing you to direct the data to the correct sheet/table in your Numbers workbook.

Add a Choose from Menu action.

In the "Prompt" field, type something like "Which account is this for?"

For each item in the menu, enter the exact name of the sheet in your Numbers workbook (e.g., "Checking", "Savings").


## Step 3: Read and Process the CSV Data

This is the core of the Shortcut, where we loop through each transaction. This will happen under each menu choice from Step 2.


For each menu option (e.g., under the "Checking" path), add the following actions:


1. Get Text: Add a Get Text from Input action. It will automatically use the file from Step 1 as its input.

2.  Split into Rows: Add a Split Text action. It will split the Text by New Lines. This gives you a list of every row in the CSV.

3.  Loop Through Rows: Add a Repeat with Each action. This will process one row at a time.

4.  Skip the Header Row (Important!): Your bank's CSV file has a header row that you don't want to import. We can skip it with a simple If condition.

Inside the Repeat with Each loop, add an If action.

Set the condition to: Repeat Index is not 1.

All the following actions (parsing and adding to Numbers) should be placed inside this If block.


## Step 4: Parse, Reorder, and Add the Row to Numbers

These actions go inside the If block from the previous step.


1. Split Row into Columns: Add another Split Text action. This time, have it split the Repeat Item by Comma. This gives you a list of all the values in that single row.

> Note: This is where the magic of reordering happens. Your bank's CSV might have columns in the order: Date, Amount, Type, Description. You will pick the items from the split text by their original position and place them into your Numbers table in your desired order.


2.  Get Each Piece of Data: Add a Get Item from List action.

Set it to get Item at Index 1 from the Split Text result. This is your Date.

Pro Tip: Add a Set Variable action right after and name it TransactionDate. This makes the Shortcut easier to read.

3.  Repeat for Other Columns: Add more Get Item from List and Set Variable actions to grab the other columns you need. You'll need to look at a sample CSV from your bank to know which index corresponds to which piece of data (e.g., Description might be at index 4, Amount at index 2).


4.  Add the Row to Numbers: This is the final action inside the loop.

Add the Add Row to Numbers Table action.

File: Select your Financial Workbook.numbers file.

Sheet: Use a text action to enter the name of the sheet for this menu path (e.g., "Checking").

Table: Enter the name of your table (e.g., "Transactions").

Values: This is where you add your variables in the correct order for your table. Tap the plus icon to add a field for each column.

In the first field, select your TransactionDate variable.

In the second field, select your TransactionDesc variable.

...and so on, matching the column order in your Numbers table.


Finally, end the If statement and the Repeat loop. Repeat these nested steps for each menu item (e.g., for the "Savings" path).


## Visualizing the Shortcut Logic


Here’s a simplified breakdown of what your final shortcut flow will look like:


```

// Shortcut: Import Bank CSV


[ ] Action: Select File (Get the .csv)

[ ] Action: Choose from Menu ("Which account?")

[ ] Case: "Checking"

[ ] Action: Get Text from File

[ ] Action: Split Text by New Lines (Get Rows)

[ ] Action: Repeat with Each (Row in Rows)

[ ] Action: If (Repeat Index is not 1) // Skip Header

[ ] Action: Split Repeat Item by Comma (Get Columns)

[ ] Action: Get Item from List (Date from Columns) -> Set Variable TransactionDate

[ ] Action: Get Item from List (Description from Columns) -> Set Variable TransactionDesc

[ ] Action: Get Item from List (Amount from Columns) -> Set Variable TransactionAmount

[ ] Action: Add Row to Numbers Table

                    File: "Financial Workbook"

                    Sheet: "Checking"

                    Table: "Transactions"

                    Values: [TransactionDate, TransactionDesc, null, TransactionAmount, null]

[ ] End If

[ ] End Repeat

[ ] Case: "Savings"

[ ] (Repeat the same logic as "Checking" but point to the "Savings" sheet)

[ ] End Menu

```


This method gives you a powerful, reusable tool to manage your finances directly on your iPad, just as you envisioned.

Chunk Created with Chunk

Start thinking in

connected pieces.

Upgrade when you're ready.

No credit card required · Available on iOS, macOS, and Web