Writing a rule
This page walks through every field in the Create Rule form, with advice on what to put in each. For the big picture on what rules are, start with What rules do.
Open the form
Go to the Rules page from the sidebar and click Create in the top-right. The form has five fields.
Account
The scope of the rule:
- All Accounts (default) — the rule applies to every account in the household.
- A specific account — the rule only runs when importing or adding to that account.
Use "All Accounts" unless you have a genuine reason not to. It's the right choice for payees that appear on more than one card.
Criteria (memo operator)
Pick one of:
- Begins With — matches when the memo starts with your pattern. Best for bank memos that have a consistent prefix like
TST* BREAKFAST BAR, where you want to match the merchant regardless of the trailing location/transaction info. - Ends With — matches when the memo ends with the pattern. Less common, but useful for some statement formats.
- Contains — matches when the pattern appears anywhere in the memo. The most forgiving option; use it when the distinctive text is buried in the middle.
- Equals — matches only when the memo is exactly the pattern (ignoring case and outer whitespace). Use this when you've standardized your memos by hand.
Case and outer whitespace are ignored in every mode.
Memo Pattern
The text to match against. 2–64 characters. Pick the shortest distinctive substring so that the rule is robust to small variations — TRADER JOE is better than TRADER JOE'S #123 BOULDER CO because the latter will break the first time a new store number shows up.
Tips:
- For Begins With and Contains, aim for enough characters to avoid false positives.
TJwould match lots of things;TRADER JOEis much safer. - Special characters and punctuation are fine in the pattern — they just have to appear in the memo verbatim (modulo case).
- You can't use regular expressions or wildcards. The match is literal.
Payee (optional)
An override for the transaction's payee. If set, LedgerBear uses this value for the payee only if the transaction doesn't already have one. 2–64 characters, or leave it blank to not override.
Typical use: cleaning up raw memo text. A bank memo like SQ *AMY'S BREAKFAST BOULDER CO with Contains AMYS BREAKFAST and a payee of Amy's Breakfast makes the transactions table readable.
Category
The category to assign. The dropdown has a type-ahead filter that searches the Group > Name label. Leave it blank if the rule only exists to set the Payee.
Like the payee, this only fills in if the transaction doesn't already have a category — so an imported row with a mapped Category column won't be overwritten.
Save
Click Create and the rule goes live immediately. It doesn't run retroactively (see What rules do), but every future import and every manually added transaction will go through it.
Check your work
Import a fresh CSV into one of the affected accounts and spot-check a few rows. If the rule isn't matching the way you expected:
- Look at the raw memo on a transaction that should have matched — Begins With and Contains are only as good as the text they're looking at.
- Remember that rules don't overwrite existing values. If the transaction had a mapped category from the CSV, the rule's category won't show.
- Only the first matching rule fires. If two rules could match the same transaction, the first one in your list wins. Tighten patterns so rules don't overlap.