Skip to main content

Rule Action Templating

danger

This is an experimental feature. That means we’re still working on finishing it. There may be bugs, missing functionality or incomplete documentation, and we may decide to remove the feature in a future release. If you have any feedback, please open an issue or post a message in the Discord.

danger

All functionality described here may not be available in the latest stable release. Use the edge images for the latest implementation.

Rule action templating allows rules to dynamically set fields based on transaction data via meta programming inside the rule.

Setting the following fields with a rule template is currently supported:

  • notes
  • date
  • amount
  • payee (name)
  • cleared (although no boolean helper functions are currently supported)

Actual uses handlebars under the hood to process the rule templates. You can find more in depth information about how this works in their guide.

Using rule action templating

You can toggle between the normal and template input modes by clicking the icon to the right of the action input box.

When the template input mode is active you can type your template into the input box as below. This example removes the string " 12345" from an imported payee and sets the payee to this new value.

Variables

VariableTypeNotes
todaydateToday's date
accountid
datedate
payeeid
imported_payeestring
notesstring
amountnumberThis is stored without the decimal place. ie. 152 will be 15200. {{div amount 100}} can be used to convert back
clearedboolean
reconciledboolean
imported_ididID of the transaction provided from an import source (eg. bank sync/QFX)
is_childbooleanFlag for children in a split transaction
is_parentbooleanFlag for the parent of a split transaction
parent_ididSet if is_child = true
scheduleid
starting_balance_flagbooleanSet if the transaction is a starting balance transaction
transfer_idid

Functions

Mathematical

FunctionArgumentsNotes
addnumber1, number2...
subnumber1, number2...
divnumber1, number2...
mulnumber1, number2...
modnumber1, number2...
floornumber
ceilnumber
roundnumber
absnumber
minnumber1, number2...
maxnumber1, number2...
fixednumber1, number2...

Text

FunctionArgumentsNotes
regexvalue, regex, replacement
replacevalue, pattern, replacementMimics js replace. When pattern is not as /regex/flags it just uses raw value as opposed to {{regex ...
replaceAllvalue, pattern, replacementMimics js replaceAll. When pattern is not as /regex/flags it just uses raw value as opposed to {{regex ...
concatvalues...Joins all arguments together

Date

FunctionArgumentsNotes
addDaysdate, number
subDaysdate, number
addWeeksdate, number
subWeeksdate, number
addMonthsdate, number
subMonthsdate, number
addYearsdate, number
subYearsdate, number
setDaydate, dayOverflows are handled, 0 will set to last day of month before
daydateExtract the day from a date
monthdateExtract the month from a date
yeardateExtract the year from a date
formatdate, format

Other

FunctionArgumentsNotes
debuganyPrints the arguments to the browser development console