Contacts, categories & rules
How to Write Rules That Categorize and Tag Transactions
Rules link transactions to contacts, categories, and tags automatically. How patterns match, how to narrow a rule, what happens when two rules disagree, and how rules treat your manual edits.
Last verified in Bankflow on October 13, 2026.
What a Rule Does
A rule is a set of text patterns that, when a transaction's description matches, links the transaction to a contact, puts it in a category, or adds a tag. Rules are what let Bankflow categorize next month's statement the way you categorized this one, without you doing it again.
There's no separate rules page. Each rule belongs to the thing it assigns, and you manage it there:
- On the Contacts page, a contact's rules decide which transactions are linked to it.
- On the Categories page's Categories and Tags tabs, a category's rules put transactions in that category, and a tag's rules add that tag.
Choose Edit from any contact, category, or tag. The words that assign it are listed under Description contains; type more separated by commas and each becomes a chip. That is its rule, and most need only the one. Words that need different conditions get a rule of their own: open the contact, category or tag, choose its Rules tab, then Add a rule. Every rule is listed there with how many transactions it matches, and is edited or deleted on its own.
Rules You Already Have
Every contact, category, and tag starts with a rule matching its own name. That's why a new category called "Netflix" immediately picks up transactions that mention Netflix. When Bankflow recognises a contact automatically, it saves the rule it used, so the next transaction from that contact matches straight away. These rules work exactly like ones you write yourself, and you can edit or delete them.
How Patterns Match
A rule matches a transaction when any of its include patterns appears in the description, and none of its exclude patterns do.
- Include patterns (Description contains): the different ways the same thing shows up on statements. For Amazon, that might be
amazon,amzn, andamazon.in. - Exclude patterns (Except when it contains): text that rules a match out. Add
refundorreversalso a returned order doesn't count as a purchase.
By default, matching ignores capitals, spaces, accents, and punctuation, and a pattern can match part of a word: uber matches "UBER *TRIP" and "UBEREATS". Click a pattern's chip for two switches that tighten that:
- Whole word only only matches the pattern as a complete word, so
uberno longer matches "UBEREATS". - Match upper and lower case makes the match case-sensitive.
Narrowing a Rule
A pattern that's right for one account can be wrong for another. Under Applies to and the folded Advanced options, a rule can be limited to:
- Money in or out: only money in, or only money out. A "salary" rule shouldn't catch a payment you sent with salary in the reference.
- Accounts: only certain banks or statements, or everything except them.
- A payee (category and tag rules): only transactions already linked to that contact. Use this to put one contact's purchases in a category without catching other transactions with similar text.
- Existing categories and tags (tag and contact rules): only transactions that are, or aren't, in a category or carrying a tag.
Category rules can also set a subcategory.
When Rules Apply
Saving a rule applies it to your existing transactions straight away, and it applies to every future import. On import, your rules run first; automatic categorization and contact recognition only handle what your rules didn't match.
Anything you set by hand is left alone. If you changed a transaction's category yourself, no rule or automatic process will change it back.
When Two Rules Disagree
Bankflow won't let two rules give the same text two different answers. If you add a pattern that another rule already uses for a different contact, category, or tag, and their scopes overlap, the rule isn't saved, and you're asked to resolve the conflict first. The same pattern is fine when the scopes can't overlap, for example one rule for money in and another for money out, or rules limited to different banks.
Longer patterns take precedence over shorter ones they contain. A category rule for amazon prime wins over one for amazon, so Prime lands in Subscriptions while other Amazon purchases land in Shopping. Tags are different: a transaction can carry several, so every matching tag rule adds its tag.
Examples
| Goal | Where | Rule |
|---|---|---|
| Group every Amazon spelling under one contact | Contacts, Amazon | Include amazon, amzn; exclude refund |
| Put rent in Housing | Categories, Housing | Include your landlord's name; money out only |
| Tag expenses to reclaim from work | Tags, Reimbursable | Include uber, hotel; only from your work card |
| Treat salary as income only | Categories, Salary | Include salary, payroll; money in only |
Next Step
Rules shape what you see on the Contacts and Categories pages. To fix a transaction your rules got wrong, change it by hand on the Transactions page; your choice sticks.