How do I use import rules?

Import rules are used to help you import transactions more efficiently. Transactions imported from banks often contain extraneous information or are not worded the way you would like them to be. Import rules allow you to clean up this extraneous information and assign categories automatically during an import. The best part is that, by automatically recording the changes you make to your transactions, Banktivity does all the work for you behind the scenes! You only need to manage import rules if you want more specific control over how they affect your imports.

To illustrate what import rules do, let's say that you update your credit card account using Direct Access, and a purchase you made at your local market shows up with a payee of "123 Main St. Market ID:992311." You edit the transaction so that the payee is "Mimi's Market" and has the category "Groceries." When you save the changes, Banktivity automatically creates an import rule for that transaction. The next time you update your credit card account, Banktivity automatically assigns the new payee and category to all transactions from that vendor!

Behind the scenes, Banktivity creates import rules based on memorized payees. All payees that have import rules attached to them are tested against every transaction you import. If an incoming transaction satisfies the conditions of the import rules, the transaction is given the memorized transaction type, payee, note, category, and splits. For more information about memorized payees, see Memorized Payees.

Please note, import rules are only created for, and applied to,` non-investment transactions.

Add and delete import rules automatically

To use import rules, first update your accounts using Direct Access, direct download, web download, or file import. Once the import is complete, view an account that contains new transactions, and select a transaction that you want to modify. Whenever you edit a transaction that was imported (not recorded manually), you will see a checkbox labeled "Create Import Rule" in the transaction editor:

If you check this box, make some changes, and save the transaction, Banktivity will create a memorized payee based on your changes and assign an import rule to it.

If the transaction was downloaded using direct download or imported from a file, its import rule will look for matching payees. If the transaction was downloaded using Direct Access, its import rule will look for matching notes.

If a memorized payee already exists with the transaction's payee field, the memorized payee details and import rule will be updated automatically. If there are other transactions in the account with the same payee, Banktivity will ask if you want to apply the changes to those transactions immediately.

For example, let's say you update your accounts using direct download, and you find a transaction with the payee "BAHAMASAIR NASSAU BHSxxxxxxxxx0827." You want to clean up the payee name and add a category. You edit the transaction and change the payee to "Bahamas Air," then assign it to the category "Travel." You check the "Create Import Rule" box and save the changes. Banktivity automatically creates a memorized payee for "Bahamas Air" with a category of "Travel," then it attaches an import rule that looks for similar payees. Banktivity prompts you to apply the changes to some other transactions in your account, and you accept. All transactions in the account that previously had the payee "BAHAMASAIR NASSAU BHSxxxxxxxxx0827" now show "Bahamas Air" and the category "Travel." The next time you update your accounts, any new transactions from Bahamas Air are cleaned up and categorized automatically.

If you don't want Banktivity to create a rule for the changes you make, uncheck "Create Import Rule" before saving the transaction details. Banktivity will delete any existing import rules that match the transaction you are editing.

If you don't want Banktivity to automatically create or update any import rules, choose Banktivity > Settings and uncheck "Automatically create import rules when editing transactions." Keep in mind that existing rules will be deleted if you leave "Create Import Rules" unchecked while editing matched transactions.

Manage import rules

Once an import rule has been created for a particular payee, Banktivity will automatically update the memorized payee associated with that rule as you make changes in the future. For example, if you decide during an import that your "Bahamas Air" transactions should actually have the payee "Bahamas Airline" and you change one transaction accordingly, Banktivity will update your import rule to apply the "Bahamas Airline" payee instead of "Bahamas Air." Because Banktivity tracks your rule changes behind the scenes like this, you typically don't need to worry about managing import rules. If you want to exert finer control over this feature, however, you can tweak the import rules manually.

To view the import rules that are currently in use, click "Configuration" in the sidebar, click "Payees, Schedules & Rules," then click "Import Rules" at the top of the list. A list of memorized that have import rules attached to them will appear:

Edit the payee details just as you would edit a transaction in a standard account register. When an incoming transaction matches the import rules for that memorized payee, the corresponding transaction type, payee, note, category, and splits will be applied to it. If any of these fields are left blank in the memorized payee, Banktivity will not change those fields on the incoming transaction.

Click the "Edit" button on the right side of a memorized payee to view its import rules in a popup window. Each transaction that you import, before it is saved to your accounts, will be evaluated by the rules in this window in order to determine whether or not the memorized payee details should be applied to it. The following illustration shows our "Bahamas Air" example from above:

Banktivity uses regular expressions to match with the details of the transactions you download. You can see that this rule is configured to look for any transactions that match the regex statement "BAHAMASAIR NASSAU BHSx+[0-9][^\p{L}]*." Any incoming transactions that match this rules will have the memorized payee details applied to them (in this case, the payee "Bahamas Air" and the category "Travel") before they are saved to the account.

Banktivity import rules follow Apple's NSRegularExpression syntax. During an import, the regex statement is matched against a string consisting of the incoming transaction's payee and note separated by a hyphen. If only one field is present in the incoming transaction, the regex statement is matched against that.

Editing rules:

In general, Banktivity will manage import rules behind the scenes and you shouldn't need to edit them manually, however Banktivity does allow you to tweak the rules it creates to better suit your workflow. Use the plus (+) and minus (-) buttons at the bottom of the popup window to add and remove, respectively, the rules that will determine which transactions are modified by the memorized payee. You can change the following options on each rule:

If multiple rules are configured for a memorized payee, an incoming transaction that matches any of the rules will be considered a match and will have the payee details assigned to it. Once you are done editing the import rules for the current payee, click "Save" to record the changes, or click "Cancel" to discard them.

The changes you make to import rules do not affect any transactions until the next time you import. Transactions already recorded in your accounts do not have the memorized payee changes applied to them.

Add and delete import rules manually

To create a new memorized payee, click "Configuration" in the sidebar, click "Payees, Schedules & Rules," and click "All Payees" at the top of the list. This will allow you to view all of your payees, regardless of whether they have import rules associated with them. Click the plus (+) button at the top left to create a new payee, then enter the payee details and save your changes.

To add import rules to the payee (or any other memorized payee in the list), click the button on the right, choose "Add Rule," and configure the rules as needed. After saving the changes you make to the import rules, click "Import Rules" at the top of the payee list to hide the payees without import rules. You will see that the payee you edited is now displayed in that list.

To remove the import rules from a payee, click "Import Rules" at the top of the list, select the payee you want, click the "Edit" button on the right, select a rule, and click the minus (-) button at the bottom of the popup window to remove the rule. Repeat for each rule until the list is empty, then click "Save" to record the changes. The payee will no longer be displayed under "Import Rules," but it will still be under "All Payees" and will be used to autofill the details of new transactions.

To delete an entire memorized payee, including its import rules and any schedules associated with it, select the payee and choose Edit > Delete or press Delete on your keyboard. Banktivity will ask for confirmation before permanently deleting the payee.

Adding and deleting import rules does not affect any transactions until the next time you import. Transactions already recorded in your accounts are not affected by adding and deleting import rules.