New to OtterLedger? Read the Documentation
45 Guides Available Quick Start Guide
Learn AI Categorization View Guide
Have Questions? Check the FAQ
New to OtterLedger? Read the Documentation
45 Guides Available Quick Start Guide
Learn AI Categorization View Guide
Have Questions? Check the FAQ

Creating Rules

Guide 24: Creating Rules

Build automatic categorization rules


Overview

Rules are the most reliable way to auto-categorize transactions. Create a rule once, and every matching transaction is categorized automatically—no AI guessing required.

What you'll learn:

  • Creating categorization rules
  • Rule conditions and actions
  • Managing and organizing rules
  • Testing and troubleshooting rules

Time required: 2-3 minutes per rule


Prerequisites

  • Categories set up
  • Some transactions to base rules on

Creating a Rule

Step 1: Open Rules

Go to BankingRules (or SettingsRules)

Step 2: Create New Rule

  1. Click Add Rule
  2. Enter rule details:

[Screenshot: Add Rule form]

Step 3: Define Conditions

Payee Conditions:

Condition Example Matches
Contains "Starbucks" "STARBUCKS #1234"
Starts with "AMZN" "AMZN MKTP US"
Equals "Netflix" Only "Netflix" exactly
Matches regex "UBER.*TRIP" "UBER TRIP 123"

Amount Conditions:

Condition Example
Greater than > $100
Less than < $10
Between $50 - $200
Equals = $9.99

Step 4: Set Actions

What happens when rule matches:

Action Description
Set Category Assign category
Set Payee Clean up payee name
Add Tag Apply tag
Mark Business Flag as business expense

Step 5: Save Rule

Click Save


Rule Examples

Basic Examples

Payee Condition Category Clean Payee
Contains "STARBUCKS" Food:Coffee Starbucks
Contains "NETFLIX" Entertainment:Streaming Netflix
Starts with "AMZN" Shopping:Online Amazon
Contains "UBER" AND < $50 Transportation:Rideshare Uber
Contains "SHELL" OR "EXXON" Auto:Gas (keep original)

Advanced Examples

Multiple Conditions:

IF payee contains "UBER"
AND amount > $100
THEN category = "Travel:Transportation"
AND tag = "Business"

Rental Income:

IF payee contains "VENMO"
AND amount = $1200
THEN category = "Income:Rental"
AND payee = "Tenant Rent"

Rule Priority

Rules run in order from top to bottom. First matching rule wins.

Ordering Rules

  1. Go to Rules
  2. Drag rules to reorder
  3. More specific rules should be higher

Example Order:

  1. "AMAZON PRIME" → Subscriptions (specific)
  2. "AMAZON" → Shopping (general)

Creating Rules from Transactions

Quick Rule Creation

  1. Open a transaction
  2. Click Create Rule
  3. Rule pre-fills with transaction details
  4. Adjust conditions
  5. Save

Bulk Rule Creation

  1. Select similar transactions
  2. Right-click → Create Rule
  3. Rule based on common patterns

Managing Rules

View All Rules

Go to BankingRules:

Rule Condition Category Matches
Starbucks Contains "STARBUCKS" Food:Coffee 47
Netflix Contains "NETFLIX" Entertainment 12
Gas Stations Contains "SHELL,EXXON,BP" Auto:Gas 28

Edit Rule

  1. Click rule name
  2. Click Edit
  3. Modify conditions/actions
  4. Save

Disable Rule

Without deleting:

  1. Click rule
  2. Toggle Enabled off
  3. Rule won't run but is preserved

Delete Rule

  1. Select rule
  2. Click Delete
  3. Confirm

Testing Rules

Test Before Saving

  1. In rule editor, click Test
  2. See which transactions would match
  3. Verify correct transactions selected
  4. Adjust conditions if needed

Apply to Existing Transactions

After creating a rule:

  1. Click Apply to Existing
  2. Choose date range
  3. Rule runs on matching transactions

Rule Conditions Reference

Text Matching

Type Syntax Example
Contains text "coffee" matches "Coffee Shop"
Starts with ^text "^UBER" matches "UBER TRIP"
Ends with text$ "INC$" matches "ACME INC"
Exact match =text "=Netflix" matches only "Netflix"
Regex /pattern/ "/UBER.*\d+/" matches "UBER TRIP 123"

Amount Matching

Type Syntax
Greater than > 100
Less than < 50
Equals = 9.99
Between 50-200

Combining Conditions

Operator Meaning Example
AND Both must match "UBER" AND > $50
OR Either matches "SHELL" OR "EXXON"
NOT Exclude "AMAZON" NOT "PRIME"

Tips & Best Practices

  1. Start broad, refine - Create general rules, add specifics as needed
  2. Use contains over equals - Bank names vary
  3. Test before applying - Preview matches first
  4. Order matters - Specific rules before general
  5. Review periodically - Remove outdated rules
  6. Document complex rules - Add notes explaining logic

Troubleshooting

Q: Rule not matching

A:

  • Check for typos in condition
  • Bank payee name may differ (check actual transaction)
  • Rule might be disabled
  • Higher-priority rule may be matching first

Q: Wrong transactions matching

A:

  • Condition too broad
  • Add more specific conditions
  • Check for overlapping rules

Q: How many rules can I have?

A: Unlimited, but 50-100 well-designed rules usually cover most needs.


What's Next?


Need help? Visit the OtterLedger community at github.com/openledger or check the FAQ.