How to craft categorizations rule
match(pattern, input)
function, which compares a pattern
, which can be text, numbers, booleans, or dates, with an attribute of the Transaction object as the input
.Transaction
object using operators and literals.Transaction
object is accessed via the symbol t
and references specific fields using .
, for example, t.description
or t.amount
.
metadata
was added to the Transaction
, you can reference it through t.metadata
. See submitting transactions for more information on adding metadata to your transactions.
Operators
and
, or
for logical AND and OR operations()
for defining the order of operations==
, >
, >=
, <
, <=
for equality and comparison+
, -
, *
, /
, %
for mathematical operationsIf/else Expression
true_expr if boolean_expr else false_expr
Literals
"string"
1.23
True
, False
datetime("2023-01-10T00:00:00.000Z")
match()
match(pattern, input)
to check if an attribute of the Transaction
object, input
, matches an arbitrary rule, pattern
. The pattern
must be a string
and can contain regular expression syntax which we recommend to write complex rules.
You can learn more about regular expressions and their syntax here.
counterparty
attribute in the metadata set to “Sophie’s Contracting LLC”: