[Feedback] Rule action templating #1487

Open
opened 2026-02-28 19:44:47 -06:00 by GiteaMirror · 64 comments
Owner

Originally created by @matt-fidd on GitHub (Oct 8, 2024).

Rule action templating allows rules to dynamically set fields based on transaction data.

To enable the feature - head over to experimental features and toggle the rule action templating feature flag. Next, go to the "rules" page and set up a new rule.

To use it, click the icon on the right hand side of the input box to toggle from "text" to "template" mode:
Text mode:
image
Template mode:
image

Then enter your template. For example, the below will replace the notes field with the VAT paid (standard VAT is 20% in the uk)
image

At the moment, templating is supported for setting:

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

Full list of available helper functions:

  • regex value regex replacement
  • add num1 num2 ...
  • sub num1 num2 ...
  • div num1 num2 ...
  • mul num1 num2 ...
  • mod num1 num2 ...
  • floor num
  • ceil num
  • round num
  • abs num
  • min num1 num2 ...
  • max num1 num2 ...
  • fixed num1 num2
  • day date
  • month date
  • year date
  • format date format
  • debug value (logs to console)
  • replace value pattern replacement mimics js replace. When pattern is not as /regex/flags it just uses raw value as opposed to {{regex ...
  • replaceAll value pattern replacement mimics js replaceAll
  • addDays date days add x days to the day
  • subDays date days
  • addWeeks date weeks
  • subWeeks date weeks
  • addMonths date months
  • subMonths date months
  • addYears date years
  • subYears date years
  • setDay date day Overflows are handled, 0 will set to last day of month before
  • concat args.. joins all arguments together

Full list of available variables that can be used

  • today (date)
  • account (id)
  • amount (number)
    • remember this is stored without the decimal place. ie. £152 will be 15200. {{div amount 100}} can be used to convert back
  • cleared (boolean)
  • date (date)
  • error (?)
  • imported_id (id)
  • imported_payee (string)
  • is_child (boolean)
  • is_parent (boolean)
  • notes (string)
  • parent_id (id)
  • payee (id)
  • reconciled (boolean)
  • schedule (id)
  • sort_order (number)
  • starting_balance_flag (boolean)
  • tombstone (boolean)
  • transfer_id (id)

Feel free to share your ideas, bug reports and feedback below.

Originally created by @matt-fidd on GitHub (Oct 8, 2024). Rule action templating allows rules to dynamically set fields based on transaction data. To enable the feature - head over to experimental features and toggle the rule action templating feature flag. Next, go to the "rules" page and set up a new rule. To use it, click the icon on the right hand side of the input box to toggle from "text" to "template" mode: Text mode: ![image](https://github.com/user-attachments/assets/e97e241e-945f-4a75-9d03-ce8927f09262) Template mode: ![image](https://github.com/user-attachments/assets/03bf8625-f582-4267-80af-dbe59886ea11) Then enter your template. For example, the below will replace the notes field with the VAT paid (standard VAT is 20% in the uk) ![image](https://github.com/user-attachments/assets/07b870c6-40e4-4d88-96d8-b7aa0d11c077) At the moment, templating is supported for setting: - notes - date - amount - cleared (although no boolean helper functions are currently supported) Full list of available helper functions: - `regex value regex replacement` - `add num1 num2 ...` - `sub num1 num2 ...` - `div num1 num2 ...` - `mul num1 num2 ...` - `mod num1 num2 ...` - `floor num` - `ceil num` - `round num` - `abs num` - `min num1 num2 ...` - `max num1 num2 ...` - `fixed num1 num2` - `day date` - `month date` - `year date` - `format date format` - `debug value` (logs to console) - `replace value pattern replacement` mimics js replace. When pattern is not as `/regex/flags` it just uses raw value as opposed to `{{regex ...` - `replaceAll value pattern replacement` mimics js replaceAll - `addDays date days` add x days to the day - `subDays date days` - `addWeeks date weeks` - `subWeeks date weeks` - `addMonths date months` - `subMonths date months` - `addYears date years` - `subYears date years` - `setDay date day` Overflows are handled, 0 will set to last day of month before - `concat args..` joins all arguments together Full list of available variables that can be used - `today (date)` - `account (id)` - `amount (number)` - remember this is stored _without_ the decimal place. ie. £152 will be `15200`. `{{div amount 100}}` can be used to convert back - `cleared (boolean)` - `date (date)` - `error (?)` - `imported_id (id)` - `imported_payee (string)` - `is_child (boolean)` - `is_parent (boolean)` - `notes (string)` - `parent_id (id)` - `payee (id)` - `reconciled (boolean)` - `schedule (id)` - `sort_order (number)` - `starting_balance_flag (boolean)` - `tombstone (boolean)` - `transfer_id (id)` --- Feel free to share your ideas, bug reports and feedback below.
GiteaMirror added the rulesfeedbackexperimental feature labels 2026-02-28 19:44:47 -06:00
Author
Owner

@youngcw commented on GitHub (Oct 8, 2024):

Some additional variables I would appreciate being added are:

  1. Current Balance of Account (extra bonus points for average monthly balance). This would be nice for automatically determining interest amounts that are included in a mortgage payment for example.

  2. Account balance on day. Useful for determining what a paid in full credit card payment will be dynamically based on current balance of the CC account within a window. (EX. Balance_today- Balance_one_month_prior = payment amount)

@youngcw commented on GitHub (Oct 8, 2024): Some additional variables I would appreciate being added are: 1. Current Balance of Account (extra bonus points for average monthly balance). This would be nice for automatically determining interest amounts that are included in a mortgage payment for example. 2. Account balance on day. Useful for determining what a paid in full credit card payment will be dynamically based on current balance of the CC account within a window. (EX. Balance_today- Balance_one_month_prior = payment amount)
Author
Owner

@UnderKoen commented on GitHub (Oct 9, 2024):

Some additional variables I would appreciate being added are:

  1. Current Balance of Account (extra bonus points for average monthly balance). This would be nice for automatically determining interest amounts that are included in a mortgage payment for example.
  2. Account balance on day. Useful for determining what a paid in full credit card payment will be dynamically based on current balance of the CC account within a window. (EX. Balance_today- Balance_one_month_prior = payment amount)

I think these could best be added as helper functions. Especially the second one.
We could use https://github.com/gastonrobledo/handlebars-async-helpers/ to make an helper that fetches on execution

@UnderKoen commented on GitHub (Oct 9, 2024): > Some additional variables I would appreciate being added are: > > 1. Current Balance of Account (extra bonus points for average monthly balance). This would be nice for automatically determining interest amounts that are included in a mortgage payment for example. > 2. Account balance on day. Useful for determining what a paid in full credit card payment will be dynamically based on current balance of the CC account within a window. (EX. Balance_today- Balance_one_month_prior = payment amount) I think these could best be added as helper functions. Especially the second one. We could use https://github.com/gastonrobledo/handlebars-async-helpers/ to make an helper that fetches on execution
Author
Owner

@mullermn commented on GitHub (Oct 21, 2024):

This looks incredibly powerful, I will turn this on and start playing with it.

My condolences to whoever eventually takes on the task of building a UI for this! 😃

@mullermn commented on GitHub (Oct 21, 2024): This looks incredibly powerful, I will turn this on and start playing with it. My condolences to whoever eventually takes on the task of building a UI for this! 😃
Author
Owner

@UnderKoen commented on GitHub (Oct 21, 2024):

I don't thing there will ever be an UI for this, (at most an helper to show which fields are available). As that it would most likely limit the usage of this function.

@UnderKoen commented on GitHub (Oct 21, 2024): I don't thing there will ever be an UI for this, (at most an helper to show which fields are available). As that it would most likely limit the usage of this function.
Author
Owner

@UnderKoen commented on GitHub (Oct 21, 2024):

Maybe fun to share, my current rules with templating
image

@UnderKoen commented on GitHub (Oct 21, 2024): Maybe fun to share, my current rules with templating ![image](https://github.com/user-attachments/assets/77f639ae-9fb8-44a3-83e0-4d12fb07ccaa)
Author
Owner

@IsThisThingStillOn commented on GitHub (Oct 28, 2024):

I'd love to see some examples of using the date functions. As of now I have only successfully got a result with {{today}}. {{day today}} for example doesn't bring up any result. {{date}} doesn't work.

What surprisingly worked was {{regex today "-[0-9]{2}-[0-9]{2}" "-11-01"}} to set the date.

But right now making date calculations doesn't seem to be supported at all, is that assumption correct? I'd love to see that as a feature. Along with other date functions (first of month, end of month etc.)

/E:
After fix #3749 day, month and year work as intended.

To everyone interested, the following rule template will move the transaction to the first of the next month (including changing the year):

{{add (year date) (floor (div (add (month date) 1) 13))}}-{{add (mod (month date) 12) 1}}-1

@IsThisThingStillOn commented on GitHub (Oct 28, 2024): I'd love to see some examples of using the date functions. As of now I have only successfully got a result with {{today}}. {{day today}} for example doesn't bring up any result. {{date}} doesn't work. What surprisingly worked was {{regex today "\-[0-9]{2}\-[0-9]{2}" "-11-01"}} to set the date. But right now making date calculations doesn't seem to be supported at all, is that assumption correct? I'd love to see that as a feature. Along with other date functions (first of month, end of month etc.) /E: After fix #3749 day, month and year work as intended. To everyone interested, the following rule template will move the transaction to the first of the next month (including changing the year): `{{add (year date) (floor (div (add (month date) 1) 13))}}-{{add (mod (month date) 12) 1}}-1`
Author
Owner

@londondev77 commented on GitHub (Nov 4, 2024):

Not sure if I'm using this wrong but I'm trying to do a currency conversion by using the following rule to set the amount:
{{ div amount 119.76 }}

I thought maybe it was down to decimal places so I also tried:
{{ fixed (div amount 119.76) 2 }}

Both result in the following error:
There was an internal error. Please get in touch https://actualbudget.org/contact for support.

If I look at the console, it shows:
Internal error: Error: Can’t convert to integer: -62.83

If I use the same rule but to set the note rather than the amount, then it works fine.

@londondev77 commented on GitHub (Nov 4, 2024): Not sure if I'm using this wrong but I'm trying to do a currency conversion by using the following rule to set the amount: `{{ div amount 119.76 }}` I thought maybe it was down to decimal places so I also tried: `{{ fixed (div amount 119.76) 2 }}` Both result in the following error: `There was an internal error. Please get in touch https://actualbudget.org/contact for support.` If I look at the console, it shows: `Internal error: Error: Can’t convert to integer: -62.83` If I use the same rule but to set the note rather than the amount, then it works fine.
Author
Owner

@UnderKoen commented on GitHub (Nov 4, 2024):

@londondev77 the amount should be in cents (*100). Decimals are not allowed,

@UnderKoen commented on GitHub (Nov 4, 2024): @londondev77 the amount should be in cents (*100). Decimals are not allowed,
Author
Owner

@londondev77 commented on GitHub (Nov 4, 2024):

Thanks. I misread the note about decimal places in the instructions at the top.

Unfortunately I can't test for the rest of the day as I've used up my GoCardless rate today.

@londondev77 commented on GitHub (Nov 4, 2024): Thanks. I misread the note about decimal places in the instructions at the top. Unfortunately I can't test for the rest of the day as I've used up my GoCardless rate today.
Author
Owner

@IsThisThingStillOn commented on GitHub (Nov 4, 2024):

@londondev77 You don't need to import transactions to test this. In the edit window of each rule you see a list of matching transactions. Just click the checkbox in the leftmost column and then click "Apply actions" in the top right above said list.

@IsThisThingStillOn commented on GitHub (Nov 4, 2024): @londondev77 You don't need to import transactions to test this. In the edit window of each rule you see a list of matching transactions. Just click the checkbox in the leftmost column and then click "Apply actions" in the top right above said list.
Author
Owner

@youngcw commented on GitHub (Nov 4, 2024):

Another useful value for the templating would be the balance of a budget category.

For example in a split rule have a split line of amount = balance of and a second split line of amount = remainder.

@youngcw commented on GitHub (Nov 4, 2024): Another useful value for the templating would be the balance of a budget category. For example in a split rule have a split line of amount = balance of <Category> and a second split line of amount = remainder.
Author
Owner

@TWilhoWI commented on GitHub (Nov 7, 2024):

Could someone help me with following: I got a monthly payment for savings. This is categorised as payment, but I want to categorise it a deposit. So from - to +. How can I do this? Amount does change every month.

@TWilhoWI commented on GitHub (Nov 7, 2024): Could someone help me with following: I got a monthly payment for savings. This is categorised as payment, but I want to categorise it a deposit. So from - to +. How can I do this? Amount does change every month.
Author
Owner

@UnderKoen commented on GitHub (Nov 7, 2024):

@TWilhoWI
image
{{mul amount -1}}

@UnderKoen commented on GitHub (Nov 7, 2024): @TWilhoWI ![image](https://github.com/user-attachments/assets/4e7fa532-931f-4bb3-9b3f-67bdf98fd17a) `{{mul amount -1}}`
Author
Owner

@TWilhoWI commented on GitHub (Nov 7, 2024):

Thank you very much!

@TWilhoWI commented on GitHub (Nov 7, 2024): Thank you very much!
Author
Owner

@nmathey commented on GitHub (Nov 7, 2024):

Wow this looks powerful!
would it be possible to extend templating to "conditions match" criterias?
Basically I would like to action a rule if the amount is a decimal number.

@nmathey commented on GitHub (Nov 7, 2024): Wow this looks powerful! would it be possible to extend templating to "conditions match" criterias? Basically I would like to action a rule if the amount is a decimal number.
Author
Owner

@IsThisThingStillOn commented on GitHub (Nov 10, 2024):

@nmathey
You can already so that with the regular filters

For payments:
amount is less than -0.00
amount is greater than -1.00

For deposits:
amount is greater than -0,00
amount is less than +1,00

@IsThisThingStillOn commented on GitHub (Nov 10, 2024): @nmathey You can already so that with the regular filters For payments: amount is less than -0.00 amount is greater than -1.00 For deposits: amount is greater than -0,00 amount is less than +1,00
Author
Owner

@nmathey commented on GitHub (Nov 12, 2024):

Mmmm rule doesn't match any

image

image

@nmathey commented on GitHub (Nov 12, 2024): Mmmm rule doesn't match any ![image](https://github.com/user-attachments/assets/349d9767-9767-4a86-a7ae-0ccff38a2156) ![image](https://github.com/user-attachments/assets/0e6c8a64-4123-43c5-a5da-c3880e62fc86)
Author
Owner

@youngcw commented on GitHub (Nov 12, 2024):

Mmmm rule doesn't match any

image

image

There isn't any templating in that rule. Also it looks like that transaction is out of range.

@youngcw commented on GitHub (Nov 12, 2024): > Mmmm rule doesn't match any > > ![image](https://private-user-images.githubusercontent.com/20896232/385097782-349d9767-9767-4a86-a7ae-0ccff38a2156.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzEzNzYyNjMsIm5iZiI6MTczMTM3NTk2MywicGF0aCI6Ii8yMDg5NjIzMi8zODUwOTc3ODItMzQ5ZDk3NjctOTc2Ny00YTg2LWE3YWUtMGNjZmYzOGEyMTU2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDExMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMTEyVDAxNDYwM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI1NWQ3OWFhODc1ZWQyNDlhODU4Y2NmY2RjMjQ0YTNiYzRjZDUxM2Q5ZWM5YmJkMmM5NDRlN2YzYTNjNTE4NzYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.mldYma4KhLotKGr3xnphWeQdreQ-65GBwzMYcaaqMP8) > > ![image](https://private-user-images.githubusercontent.com/20896232/385097987-0e6c8a64-4123-43c5-a5da-c3880e62fc86.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzEzNzYyNjMsIm5iZiI6MTczMTM3NTk2MywicGF0aCI6Ii8yMDg5NjIzMi8zODUwOTc5ODctMGU2YzhhNjQtNDEyMy00M2M1LWE1ZGEtYzM4ODBlNjJmYzg2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDExMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMTEyVDAxNDYwM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTM1MmIwNjVkM2I1OTI2ZjI5OGFkZTExODVlZjZmOGE0N2VkNDdjMjBiMThiMzZhMjQzMjAwYzYyNjczMTE2NDMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.7W_bLzI4OJZrXJDRzfKKO5Cv78UKyC_Q5VzgEdQVfvc) There isn't any templating in that rule. Also it looks like that transaction is out of range.
Author
Owner

@nmathey commented on GitHub (Nov 12, 2024):

Yeah I just tried to apply whats @IsThisThingStillOn were referring too even if it looked weird for me as is.
I want to basically match any decimal number not only a range and do not match if integer: that was my point to extend templating rule in "conditions match" in order to extend filter possibility.
If it is still valid for my use case, I'll switch to discord to avoid polluting this thread.

@nmathey commented on GitHub (Nov 12, 2024): Yeah I just tried to apply whats @IsThisThingStillOn were referring too even if it looked weird for me as is. I want to basically match any decimal number not only a range and do not match if integer: that was my point to extend templating rule in "conditions match" in order to extend filter possibility. If it is still valid for my use case, I'll switch to discord to avoid polluting this thread.
Author
Owner

@UnderKoen commented on GitHub (Nov 12, 2024):

Basically I would like to action a rule if the amount is a decimal number.

We could achieve this by adding regex matching to the amount field. I will look if I can get this working.

@UnderKoen commented on GitHub (Nov 12, 2024): > Basically I would like to action a rule if the amount is a decimal number. We could achieve this by adding regex matching to the amount field. I will look if I can get this working.
Author
Owner

@gael-vanderlee commented on GitHub (Nov 15, 2024):

My imported payees always start with "CARDXXXX" or "CARDXXXX DD/MM", would this new feature allow me to remove those automatically ?

@gael-vanderlee commented on GitHub (Nov 15, 2024): My imported payees always start with "CARDXXXX" or "CARDXXXX DD/MM", would this new feature allow me to remove those automatically ?
Author
Owner

@youngcw commented on GitHub (Nov 15, 2024):

My imported payees always start with "CARDXXXX" or "CARDXXXX DD/MM", would this new feature allow me to remove those automatically ?

It could, but you probably should be able to use a regular "imported_payee"-"contains" rule and not need to use a template rule.

@youngcw commented on GitHub (Nov 15, 2024): > My imported payees always start with "CARDXXXX" or "CARDXXXX DD/MM", would this new feature allow me to remove those automatically ? It could, but you probably should be able to use a regular "imported_payee"-"contains" rule and not need to use a template rule.
Author
Owner

@gael-vanderlee commented on GitHub (Nov 15, 2024):

@youngcw Ah nice !
How would I set that up in the payee section ? I'd like a rule that goes for any transaction of the form CARD XXXX DD/MM YYYYY:

  • If imported payee matches (regex expression)
  • Set payee to YYYY

I'm struggling to know how to extract the YYYY information from the imported payee to set it in the payee field. Hope that makes sense

@gael-vanderlee commented on GitHub (Nov 15, 2024): @youngcw Ah nice ! How would I set that up in the payee section ? I'd like a rule that goes for any transaction of the form `CARD XXXX DD/MM YYYYY`: - If `imported payee` matches `(regex expression)` - Set payee to `YYYY` I'm struggling to know how to extract the `YYYY` information from the `imported payee` to set it in the `payee` field. Hope that makes sense
Author
Owner

@youngcw commented on GitHub (Nov 15, 2024):

@youngcw Ah nice ! How would I set that up in the payee section ? I'd like a rule that goes for any transaction of the form CARD XXXX DD/MM YYYYY:

  • If imported payee matches (regex expression)
  • Set payee to YYYY

I'm struggling to know how to extract the YYYY information from the imported payee to set it in the payee field. Hope that makes sense

I don't think you need to extract anything. Use if imported payee contains "Grocery Store", set payee "Grocery Store"

@youngcw commented on GitHub (Nov 15, 2024): > @youngcw Ah nice ! How would I set that up in the payee section ? I'd like a rule that goes for any transaction of the form `CARD XXXX DD/MM YYYYY`: > > * If `imported payee` matches `(regex expression)` > * Set payee to `YYYY` > > I'm struggling to know how to extract the `YYYY` information from the `imported payee` to set it in the `payee` field. Hope that makes sense I don't think you need to extract anything. Use if imported payee contains "Grocery Store", set payee "Grocery Store"
Author
Owner

@gael-vanderlee commented on GitHub (Nov 15, 2024):

@youngcw Ah yes I already do that, but a universal rule on import would help a lot with readability when sorting through the transactions. Hopefully that's possible with rule action templating.

Since the proposed solution includes regex replacement and imported payee, it's looking promising !

@gael-vanderlee commented on GitHub (Nov 15, 2024): @youngcw Ah yes I already do that, but a universal rule on import would help a lot with readability when sorting through the transactions. Hopefully that's possible with rule action templating. Since the proposed solution includes regex replacement and imported payee, it's looking promising !
Author
Owner

@matt-fidd commented on GitHub (Nov 15, 2024):

@youngcw Ah yes I already do that, but a universal rule on import would help a lot with readability when sorting through the transactions. Hopefully that's possible with rule action templating.

I think you should be able to do something like the below... it might need a bit of tweaking though

if: imported payee contains "CARD" (regex is not availble for rule criteria) AND account = the account you're seeing this on
set payee = {{regex imported_payee "^CARD\s.*\s\d{2}\\\d{2}\s(.*)$" "$1"}}

@matt-fidd commented on GitHub (Nov 15, 2024): > @youngcw Ah yes I already do that, but a universal rule on import would help a lot with readability when sorting through the transactions. Hopefully that's possible with rule action templating. I think you should be able to do something like the below... it might need a bit of tweaking though if: imported payee contains "CARD" (regex is not availble for rule criteria) AND account = the account you're seeing this on set payee = `{{regex imported_payee "^CARD\s.*\s\d{2}\\\d{2}\s(.*)$" "$1"}}`
Author
Owner

@gael-vanderlee commented on GitHub (Nov 15, 2024):

Had to make a few tweaks (mine is in french so "Carte XXXXX" and the date field is optional). For those interested, the final formula is {{regex imported_payee "^Carte X\d{4}(\s+\d{2}/\d{2})?\s+(.*)$" "$2"}}
Thank you very much for the help ! Came to github to make a feature request and left with a working solution :)

@gael-vanderlee commented on GitHub (Nov 15, 2024): Had to make a few tweaks (mine is in french so "Carte XXXXX" and the date field is optional). For those interested, the final formula is `{{regex imported_payee "^Carte X\d{4}(\s+\d{2}/\d{2})?\s+(.*)$" "$2"}}` Thank you very much for the help ! Came to github to make a feature request and left with a working solution :)
Author
Owner

@fossum commented on GitHub (Nov 29, 2024):

My only issue right now is, I can't choose the order. I'd like it to be above some of my set payee rules, but it's right in the middle for some reason.

@fossum commented on GitHub (Nov 29, 2024): My only issue right now is, I can't choose the order. I'd like it to be above some of my set payee rules, but it's right in the middle for some reason.
Author
Owner

@Chuckame commented on GitHub (Dec 11, 2024):

The UI is quite difficult, even as a software engineer who loves regex 😄

There is no feedback on the regex execution: is the regex valid ? what is going on if I apply the regex (a dry-run is missing) ?

I'm doing exactly the same as many of you: extract payee and date from the imported_payee.

Here is my solution for the pattern Cb <payee> Fact DDMMYY <card number>:

  • when imported_payee matches ^Cb .+ Fact \d{6} .*$
  • set payee (name) to template {{regex imported_payee "^Cb (.+) Fact (\d{2})(\d{2})(\d{2}) .*$" "$1"}}
  • set date to template {{regex imported_payee "^Cb (.+) Fact (\d{2})(\d{2})(\d{2}) .*$" "20$4-$3-$2"}}

Note

The date is not following the display format but the ISO8601 format like YYYY-MM-DD, the reason why I prepend 20 to the year group 4

Btw, it could be awesome to use the condition catched groups to to repeat the regex like:

  • when imported_payee matches ^Cb (.+) Fact (\d{2})(\d{2})(\d{2}) .*$
  • set payee (name) to template {{regex_replacement "$1"}}
  • set date to template {{regex_replacement "20$4-$3-$2"}}

And even better using group names to better understand the catched groups:

  • when imported_payee matches ^Cb (?<payee>.+) Fact (?<day>\d{2})(?<month>\d{2})(?<year>\d{2}) .*$
  • set payee (name) to template {{regex_replacement "${payee}"}}
  • set date to template {{regex_replacement "20${year}-${month}-${day}"}}

Quick proposal: change the date template placeholder from nothing to YYYY-MM-DD (ISO8601 date)

@Chuckame commented on GitHub (Dec 11, 2024): The UI is quite difficult, even as a software engineer who loves regex 😄 There is no feedback on the regex execution: is the regex valid ? what is going on if I apply the regex (a dry-run is missing) ? I'm doing exactly the same as many of you: extract payee and date from the imported_payee. Here is my solution for the pattern `Cb <payee> Fact DDMMYY <card number>`: - when `imported_payee` matches `^Cb .+ Fact \d{6} .*$` - set `payee (name)` to template `{{regex imported_payee "^Cb (.+) Fact (\d{2})(\d{2})(\d{2}) .*$" "$1"}}` - set `date` to template `{{regex imported_payee "^Cb (.+) Fact (\d{2})(\d{2})(\d{2}) .*$" "20$4-$3-$2"}}` > [!NOTE] > The date is not following the display format but the ISO8601 format like `YYYY-MM-DD`, the reason why I prepend `20` to the year group `4` Btw, it could be awesome to use the condition catched groups to to repeat the regex like: - when `imported_payee` matches `^Cb (.+) Fact (\d{2})(\d{2})(\d{2}) .*$` - set `payee (name)` to template `{{regex_replacement "$1"}}` - set `date` to template `{{regex_replacement "20$4-$3-$2"}}` And even better using group names to better understand the catched groups: - when `imported_payee` matches `^Cb (?<payee>.+) Fact (?<day>\d{2})(?<month>\d{2})(?<year>\d{2}) .*$` - set `payee (name)` to template `{{regex_replacement "${payee}"}}` - set `date` to template `{{regex_replacement "20${year}-${month}-${day}"}}` Quick proposal: change the date template placeholder from `nothing` to `YYYY-MM-DD (ISO8601 date)`
Author
Owner

@tcpr1 commented on GitHub (Jan 8, 2025):

I would like to multiply the amount of a transaction by the total number os installments.

Example, in the notes I have: installment 01/03.
Is it possible to get the number after "/" an use it to multiple the amount, like a variable?

Something like: Set amount {{mul amount N}} where in this case N = 03.

@tcpr1 commented on GitHub (Jan 8, 2025): I would like to multiply the amount of a transaction by the total number os installments. Example, in the notes I have: installment 01/03. Is it possible to get the number after "/" an use it to multiple the amount, like a variable? Something like: Set amount {{mul amount N}} where in this case N = 03.
Author
Owner

@UnderKoen commented on GitHub (Jan 9, 2025):

@tcpr1 You can do the following
{{mul amount (regex notes "/^.*\d+/(\d+).*$/" "$1")}}

@UnderKoen commented on GitHub (Jan 9, 2025): @tcpr1 You can do the following `{{mul amount (regex notes "/^.*\d+/(\d+).*$/" "$1")}}`
Author
Owner

@tcpr1 commented on GitHub (Jan 10, 2025):

@tcpr1 You can do the following {{mul amount (regex notes "/^.*\d+/(\d+).*$/" "$1")}}

Perfect, thank you! Very cool feature.

@tcpr1 commented on GitHub (Jan 10, 2025): > @tcpr1 You can do the following `{{mul amount (regex notes "/^.*\d+/(\d+).*$/" "$1")}}` Perfect, thank you! Very cool feature.
Author
Owner

@psybers commented on GitHub (Jan 12, 2025):

I think if you enter in a bad/invalid template you just get a generic error. Might be nice to give better feedback to the user that the problem is their template is bad. As an example, try entering in mul 0.5 {{amount}}.

@psybers commented on GitHub (Jan 12, 2025): I think if you enter in a bad/invalid template you just get a generic error. Might be nice to give better feedback to the user that the problem is their template is bad. As an example, try entering in `mul 0.5 {{amount}}`.
Author
Owner

@tostasmistas commented on GitHub (Jan 22, 2025):

Nice feature!

Do you know if it's possible to combine the format helper function with other functions? I wanted to set the notes field to the first of the next month, but with the date formatted as "MMMM yyyy". So maybe something like:

{{format (add (year date) (floor (div (add (month date) 1) 13))}}-{{add (mod (month date) 12) 1}}-1) "MMMM yyyy"}}

Although the above comes up as Invalid handlebars template.

@tostasmistas commented on GitHub (Jan 22, 2025): Nice feature! Do you know if it's possible to combine the `format` helper function with other functions? I wanted to set the `notes` field to the first of the next month, but with the date formatted as `"MMMM yyyy"`. So maybe something like: `{{format (add (year date) (floor (div (add (month date) 1) 13))}}-{{add (mod (month date) 12) 1}}-1) "MMMM yyyy"}}` Although the above comes up as `Invalid handlebars template`.
Author
Owner

@snqyz commented on GitHub (Jan 25, 2025):

Thanks for this feature!

I am experiencing a bug where the regex substitution works only on first match.

Example

My rule: {{regex notes "\s+" " "}}
Input: "foo bar test"
Output: "foo bar test"

@snqyz commented on GitHub (Jan 25, 2025): Thanks for this feature! I am experiencing a bug where the regex substitution works only on first match. ### Example My rule: `{{regex notes "\s+" " "}}` Input: `"foo bar test"` Output: `"foo bar test"`
Author
Owner

@UnderKoen commented on GitHub (Jan 26, 2025):

@snqyz this is intented. It uses the normal replace behaviour.

You should use {{regex notes "/\s+/g" " "}}

The global flag let i match more than once

@UnderKoen commented on GitHub (Jan 26, 2025): @snqyz this is intented. It uses the normal replace behaviour. You should use `{{regex notes "/\s+/g" " "}}` The global flag let i match more than once
Author
Owner

@UnderKoen commented on GitHub (Jan 26, 2025):

Do you know if it's possible to combine the format helper function with other functions? I wanted to set the notes field to the first of the next month, but with the date formatted as "MMMM yyyy".

@tostasmistas unfortunatly currently not. I will be adding an function to changing dates by an amount. And a method for concatenation

@UnderKoen commented on GitHub (Jan 26, 2025): > Do you know if it's possible to combine the `format` helper function with other functions? I wanted to set the `notes` field to the first of the next month, but with the date formatted as `"MMMM yyyy"`. @tostasmistas unfortunatly currently not. I will be adding an function to changing dates by an amount. And a method for concatenation
Author
Owner

@mr-ister commented on GitHub (Jan 31, 2025):

I'm trying to set the transaction date based on the imported_payee field, but for some reason I keep getting an error message (Something internally went wrong. You may want to restart the app if anything looks wrong. Please report this as a new issue on Github.).

My template looks like this:

  • If imported payee is not nothing
  • Then set date to {{regex imported_payee "(\d{2})\.(\d{2})\.\s\d{2}:\d{2}" "2025-$2-$1"}}

My strings look like this:

  • Pos 5,06 at K20 28.01. 09:59 O
  • Store 3114 2360 K20 28.01. 14:34

Any ideas where I went wrong? Thanks!

@mr-ister commented on GitHub (Jan 31, 2025): I'm trying to set the transaction date based on the imported_payee field, but for some reason I keep getting an error message (`Something internally went wrong. You may want to restart the app if anything looks wrong. Please report this as a new issue on Github.`). My template looks like this: * If `imported payee` is not `nothing` * Then set `date` to `{{regex imported_payee "(\d{2})\.(\d{2})\.\s\d{2}:\d{2}" "2025-$2-$1"}}` My strings look like this: * Pos 5,06 at K20 28.01. 09:59 O * Store 3114 2360 K20 28.01. 14:34 Any ideas where I went wrong? Thanks!
Author
Owner

@matt-fidd commented on GitHub (Jan 31, 2025):

@mr-ister I've not tested this but I think the replacement will only work on the matched substring.

Try changing the regex to match the entire string.

- {{regex imported_payee "(\d{2})\.(\d{2})\.\s\d{2}:\d{2}" "2025-$2-$1"}}
+ {{regex imported_payee "^.*(\d{2})\.(\d{2})\.\s\d{2}:\d{2}.*$" "2025-$2-$1"}}
@matt-fidd commented on GitHub (Jan 31, 2025): @mr-ister I've not tested this but I think the replacement will only work on the matched substring. Try changing the regex to match the entire string. ```diff - {{regex imported_payee "(\d{2})\.(\d{2})\.\s\d{2}:\d{2}" "2025-$2-$1"}} + {{regex imported_payee "^.*(\d{2})\.(\d{2})\.\s\d{2}:\d{2}.*$" "2025-$2-$1"}} ```
Author
Owner

@mr-ister commented on GitHub (Jan 31, 2025):

That's perfect, it's working, thank you!

@mr-ister commented on GitHub (Jan 31, 2025): That's perfect, it's working, thank you!
Author
Owner

@IsThisThingStillOn commented on GitHub (Feb 7, 2025):

Can someone share working examples for date functions like addDays, subDays etc. and how to set a new date with them?

I can't get them to work.

@IsThisThingStillOn commented on GitHub (Feb 7, 2025): Can someone share working examples for date functions like addDays, subDays etc. and how to set a new date with them? I can't get them to work.
Author
Owner

@UnderKoen commented on GitHub (Feb 11, 2025):

@IsThisThingStillOn

Can someone share working examples for date functions like addDays, subDays etc. and how to set a new date with them?

I can't get them to work.

This will be fixed with https://github.com/actualbudget/actual/pull/4356

@UnderKoen commented on GitHub (Feb 11, 2025): @IsThisThingStillOn > Can someone share working examples for date functions like addDays, subDays etc. and how to set a new date with them? > > I can't get them to work. This will be fixed with https://github.com/actualbudget/actual/pull/4356
Author
Owner

@b-neufeld commented on GitHub (Feb 19, 2025):

This is awesome. I was looking for something like this... and found it!

Some ideas & suggestions:

  1. The text mode/template mode icons are not immediately intuitive and there's no mouseover label for what they do. Suggest adding a mouseover to help users understand which is which ("am I switching TO this mode, or am I in this mode now?") Or maybe instead of <> the symbol should be { }?
  2. Suggest the error-checking logic that generates the "Invalid handlebars template" message is triggered/updated when the "Apply actions" button is clicked, or even after clicking out of the action field. I was trying to "preview" the logic on one transaction and getting no feedback, and only got the error on Save. Conversely, if I fixed my logic and clicked "Apply actions" after that, I'd be successfully updating transactions but still seeing an error message.
  3. Would it be possible to enable this with the "append/prepend to" function for the notes field? In my use case below, I lose the small piece of information that the .qfx import originally drops into the Notes field, since there is no such field as imported_notes to play with.

My simple use case for this is as follows. I import all transactions as .QFX files from my bank. Interac e-Transfers (Canadians will know) can be a mess, with payee names getting cut off and/or generating a huge number of Actual payees.

Before I had completely replaced the Imported Payee (which might be something like "INTERAC e-Transfer From: Maria" with the payee "Interac e-Transfer" (I usually don't care about individual names as these are mostly one-off Marketplace transactions). However, the downside is that that little bit of name that might have helped me categorize the transaction was gone.

Solution: A simple Find and Replace on the imported_payee and drop that in the notes field.

Image

Image

@b-neufeld commented on GitHub (Feb 19, 2025): This is awesome. I was looking for something like this... and found it! Some ideas & suggestions: 1. The text mode/template mode icons are not immediately intuitive and there's no mouseover label for what they do. Suggest adding a mouseover to help users understand which is which ("am I switching TO this mode, or am I in this mode now?") Or maybe instead of <> the symbol should be { }? 2. Suggest the error-checking logic that generates the "Invalid handlebars template" message is triggered/updated when the "Apply actions" button is clicked, or even after clicking out of the action field. I was trying to "preview" the logic on one transaction and getting no feedback, and only got the error on Save. Conversely, if I fixed my logic and clicked "Apply actions" after that, I'd be successfully updating transactions but still seeing an error message. 3. Would it be possible to enable this with the "append/prepend to" function for the notes field? In my use case below, I lose the small piece of information that the .qfx import originally drops into the Notes field, since there is no such field as `imported_notes` to play with. My simple use case for this is as follows. I import all transactions as .QFX files from my bank. Interac e-Transfers (Canadians will know) can be a mess, with payee names getting cut off and/or generating a huge number of Actual payees. Before I had completely replaced the Imported Payee (which might be something like "INTERAC e-Transfer From: Maria" with the payee "Interac e-Transfer" (I usually don't care about individual names as these are mostly one-off Marketplace transactions). However, the downside is that that little bit of name that might have helped me categorize the transaction was gone. Solution: A simple Find and Replace on the `imported_payee` and drop that in the notes field. ![Image](https://github.com/user-attachments/assets/d38143a9-b224-4216-a4a3-ea005ad07819) ![Image](https://github.com/user-attachments/assets/44da165e-3bff-4c6c-b132-4eb7f9249ec2)
Author
Owner

@hsrthe4th commented on GitHub (Feb 23, 2025):

Apologies if this should be in a separate error report.
I noticed when a field is in template mode and you make a change and then exit out of the rule without saving (cancel or popup X) it will still save the changes.
In text mode it behaves correctly

@hsrthe4th commented on GitHub (Feb 23, 2025): Apologies if this should be in a separate error report. I noticed when a field is in template mode and you make a change and then exit out of the rule without saving (cancel or popup X) it will still save the changes. In text mode it behaves correctly
Author
Owner

@ToniCipriani commented on GitHub (Mar 10, 2025):

When editing a schedule as a rule, can the schedule name be used as a variable? I only see schedule ID.

@ToniCipriani commented on GitHub (Mar 10, 2025): When editing a schedule as a rule, can the schedule name be used as a variable? I only see schedule ID.
Author
Owner

@skyfenton commented on GitHub (Mar 16, 2025):

Some additional variables I would appreciate being added are:

1. Current Balance of Account (extra bonus points for average monthly balance).  This would be nice for automatically determining interest amounts that are included in a mortgage payment for example.

2. Account balance on day.  Useful for determining what a paid in full credit card payment will be dynamically based on current balance of the CC account within a window. (EX. Balance_today- Balance_one_month_prior = payment amount)

Would love to see this. Although I usually just look over at the account list, it would be nice to have that number somewhere in my monthly budget category or schedules with rules/templates. Maybe this should be done as a budget template rule target i.e. #template 100% of ?

@skyfenton commented on GitHub (Mar 16, 2025): > Some additional variables I would appreciate being added are: > > 1. Current Balance of Account (extra bonus points for average monthly balance). This would be nice for automatically determining interest amounts that are included in a mortgage payment for example. > > 2. Account balance on day. Useful for determining what a paid in full credit card payment will be dynamically based on current balance of the CC account within a window. (EX. Balance_today- Balance_one_month_prior = payment amount) Would love to see this. Although I usually just look over at the account list, it would be nice to have that number somewhere in my monthly budget category or schedules with rules/templates. Maybe this should be done as a budget template rule target i.e. #template 100% of <Credit Card Account>?
Author
Owner

@davitomi commented on GitHub (Mar 29, 2025):

Thank you for this feature! I don't know how complex this would be, but I would appreciate it VERY MUCH if split transactions would be handled. My use case is withdrawing money in the grocery store. This is then one single transaction, where the notes field contains the amount withdrawn, and the rest is the amount that was simply paid. Unfortunately, the amount field cannot be set for split transactions, and interaction between the "parent" and "child" transactions also don't seem possible (that way I could write the amount into the notes field of the respective transaction, and maybe set the amount with a separate rule?).

This is how I calculate the amount of money withdrawn:
Image

@davitomi commented on GitHub (Mar 29, 2025): Thank you for this feature! I don't know how complex this would be, but I would appreciate it VERY MUCH if split transactions would be handled. My use case is withdrawing money in the grocery store. This is then one single transaction, where the notes field contains the amount withdrawn, and the rest is the amount that was simply paid. Unfortunately, the amount field cannot be set for split transactions, and interaction between the "parent" and "child" transactions also don't seem possible (that way I could write the amount into the notes field of the respective transaction, and maybe set the amount with a separate rule?). This is how I calculate the amount of money withdrawn: <img width="495" alt="Image" src="https://github.com/user-attachments/assets/b477ece0-fb39-4e8e-8d9e-e72277829191" />
Author
Owner

@BobWs commented on GitHub (May 11, 2025):

I want to include the payee's name in the notes for my transactions, but I'm having trouble figuring out how to do this using the rule templating feature.

For example, if the payee is "Starbucks" and the transaction is a card payment, I want to add the following note:
Starbucks - Card Payment Coffee {{year date}}.{{month.date}}

The date part is working fine, but I can't figure out how to automatically add the payee's name.

Is this possible? If so, could someone please help me with this?

Thank you in advance!

@BobWs commented on GitHub (May 11, 2025): I want to include the payee's name in the notes for my transactions, but I'm having trouble figuring out how to do this using the rule templating feature. For example, if the payee is "Starbucks" and the transaction is a card payment, I want to add the following note: `Starbucks - Card Payment Coffee {{year date}}.{{month.date}}` The date part is working fine, but I can't figure out how to automatically add the payee's name. Is this possible? If so, could someone please help me with this? Thank you in advance!
Author
Owner

@UnderKoen commented on GitHub (May 14, 2025):

Hi @BobWs you can use {{payee_name}}

@UnderKoen commented on GitHub (May 14, 2025): Hi @BobWs you can use `{{payee_name}}`
Author
Owner

@BobWs commented on GitHub (May 14, 2025):

Hi @BobWs you can use {{payee_name}}

Thanks it worked!
I'm also trying to change the date format to DD-MM-YYYY, but this doesn't work {{format {{addMonths date}} 'DD-MM-YYYY'}}

Can you tell what I'm doing wrong? How do I use the format function in note to change the date

@BobWs commented on GitHub (May 14, 2025): > Hi [@BobWs](https://github.com/BobWs) you can use `{{payee_name}}` Thanks it worked! I'm also trying to change the date format to `DD-MM-YYYY`, but this doesn't work `{{format {{addMonths date}} 'DD-MM-YYYY'}}` Can you tell what I'm doing wrong? How do I use the `format` function in note to change the `date`
Author
Owner

@UnderKoen commented on GitHub (May 14, 2025):

Hi @BobWs you should use dd-MM-yyyy. Addtionally the addMonths takes two arguments so {{format (addMonths date 1) 'dd-MM-yyyy'}}

@UnderKoen commented on GitHub (May 14, 2025): Hi @BobWs you should use `dd-MM-yyyy`. Addtionally the `addMonths` takes two arguments so `{{format (addMonths date 1) 'dd-MM-yyyy'}}`
Author
Owner

@BobWs commented on GitHub (May 14, 2025):

{{format (addMonths date 1) 'dd-MM-yyyy'}}

Thanks, @UnderKoen! This makes much more sense now. I initially thought it wasn't possible, so I was only using {{addMonths date}}. However, now that I see it can be done, I can start fresh. Hahaha!

Thank you for explaining.

@BobWs commented on GitHub (May 14, 2025): > {{format (addMonths date 1) 'dd-MM-yyyy'}} Thanks, @UnderKoen! This makes much more sense now. I initially thought it wasn't possible, so I was only using {{addMonths date}}. However, now that I see it can be done, I can start fresh. Hahaha! Thank you for explaining.
Author
Owner

@iam-gauravgupta commented on GitHub (Jun 19, 2025):

Hi @matt-fidd
Any specific reason why the full list of variables and keyword’s not part of the official documentation?

@iam-gauravgupta commented on GitHub (Jun 19, 2025): Hi @matt-fidd Any specific reason why the full list of variables and keyword’s not part of the official documentation?
Author
Owner

@zmasterar commented on GitHub (Jun 28, 2025):

Some additional variables I would appreciate being added are:

  1. Current Balance of Account (extra bonus points for average monthly balance). This would be nice for automatically determining interest amounts that are included in a mortgage payment for example.

I would really love to see this. It'd help me a lot.

@zmasterar commented on GitHub (Jun 28, 2025): > Some additional variables I would appreciate being added are: > > 1. Current Balance of Account (extra bonus points for average monthly balance). This would be nice for automatically determining interest amounts that are included in a mortgage payment for example. I would really love to see this. It'd help me a lot.
Author
Owner

@HosseyNJF commented on GitHub (Jun 29, 2025):

I created a richer multi-currency rule, allowing for fluctuating currency rates. It works by putting the amount in foreign currency in the amount field and the FX rate (actually 1/FX rate) in the note field. It would then divide the amount by fx rate and put the result in the amount field, while filling the note correctly like the official provided rule here. It also adds the thousands separator, which I believe is beneficial to add as a function. it was TOUGH to implement as a regex.

One thing I couldn't find a way around is how can I write a memo AND the FX rate in the note field at the same time and still get proper result. I would appreciate any idea on this.

It still has the drawback of the account balance drifting away from reality, and requires frequent reconciliation. But this is how I manually created transactions and formatted the note in YNAB, and this feature allowed me to just put in the amount and FX rate and let it do its job. And as I usually empty my foreign accounts to zero, I rarely have to deal with reconciliation. Anyway, sharing it in case it could be useful for someone!

Image

Raw templates (adjust the currency from IRR to yours, also replace div with mul in the second template if the currency pair's price is close to 1. I had to put it this way because IRR/USD is 900000 (yes, 5 zeros) and the standard FX rate would become 0.00000011. the other way around was just easier to work with for me)

  • {{concat (regex (round (div amount 100)) "/(\d)(?=(\d\d\d)+(?!\d))/g" "$1,") " IRR (FX rate: " notes ")" }}
  • {{ceil (div amount (regex notes "/.* \(FX rate: (\d+?)\).*/g" "$1"))}}
@HosseyNJF commented on GitHub (Jun 29, 2025): I created a richer multi-currency rule, allowing for fluctuating currency rates. It works by putting the amount in foreign currency in the amount field and the FX rate (actually 1/FX rate) in the note field. It would then divide the amount by fx rate and put the result in the amount field, while filling the note correctly like the official provided rule [here](https://actualbudget.org/docs/budgeting/multi-currency/). It also adds the thousands separator, which I believe is beneficial to add as a function. it was TOUGH to implement as a regex. One thing I couldn't find a way around is how can I write a memo AND the FX rate in the note field at the same time and still get proper result. I would appreciate any idea on this. It still has the drawback of the account balance drifting away from reality, and requires frequent reconciliation. But this is how I manually created transactions and formatted the note in YNAB, and this feature allowed me to just put in the amount and FX rate and let it do its job. And as I usually empty my foreign accounts to zero, I rarely have to deal with reconciliation. Anyway, sharing it in case it could be useful for someone! ![Image](https://github.com/user-attachments/assets/72a1d961-38e2-40d1-a47f-ae6f4ff1b234) Raw templates (adjust the currency from IRR to yours, also replace div with mul in the second template if the currency pair's price is close to 1. I had to put it this way because IRR/USD is 900000 (yes, 5 zeros) and the standard FX rate would become 0.00000011. the other way around was just easier to work with for me) - `{{concat (regex (round (div amount 100)) "/(\d)(?=(\d\d\d)+(?!\d))/g" "$1,") " IRR (FX rate: " notes ")" }}` - `{{ceil (div amount (regex notes "/.* \(FX rate: (\d+?)\).*/g" "$1"))}}`
Author
Owner

@youngcw commented on GitHub (Jul 22, 2025):

It would be nice if you could use this with splits in rules. Currently you can only use fixed amounts, fixed percentages, or a portion of the remainder in rule splits.

@youngcw commented on GitHub (Jul 22, 2025): It would be nice if you could use this with splits in rules. Currently you can only use fixed amounts, fixed percentages, or a portion of the remainder in rule splits.
Author
Owner

@atgrey24 commented on GitHub (Jul 27, 2025):

Some additional variables I would appreciate being added are:

  1. Current Balance of Account (extra bonus points for average monthly balance). This would be nice for automatically determining interest amounts that are included in a mortgage payment for example.
  2. Account balance on day. Useful for determining what a paid in full credit card payment will be dynamically based on current balance of the CC account within a window. (EX. Balance_today- Balance_one_month_prior = payment amount)

Has the Balance variable been added yet? Calculating interest is the primary use case for me, so I'd love to see this

@atgrey24 commented on GitHub (Jul 27, 2025): > Some additional variables I would appreciate being added are: > > 1. Current Balance of Account (extra bonus points for average monthly balance). This would be nice for automatically determining interest amounts that are included in a mortgage payment for example. > 2. Account balance on day. Useful for determining what a paid in full credit card payment will be dynamically based on current balance of the CC account within a window. (EX. Balance_today- Balance_one_month_prior = payment amount) Has the Balance variable been added yet? Calculating interest is the primary use case for me, so I'd love to see this
Author
Owner

@leonhardvohla commented on GitHub (Sep 18, 2025):

Hi, I'm trying to run this regex but it doesn't seem to work with the notes field. I have another regex with payee (name) that does work. It finds matching transactions but if I select them and click Apply actions nothing happens to the preview Notes fields and also exiting the rule none of my transactions have changed. Am I doing something wrong or is it a bug? I'm on these versions, server hosted on Fly:

Client version: v25.9.0
Server version: v25.9.0

Regex to edit note fields with "((To John Doe Dinner))" to just "Dinner":
{{regex notes "^\s*(?:((\s*)?[Tt]o\s+(.+?)\s+(\S(?:.\S)?)\s(?:)))?\s*$" "$2"}}

Image
@leonhardvohla commented on GitHub (Sep 18, 2025): Hi, I'm trying to run this regex but it doesn't seem to work with the `notes` field. I have another regex with `payee (name)` that does work. It finds matching transactions but if I select them and click `Apply actions` nothing happens to the preview Notes fields and also exiting the rule none of my transactions have changed. Am I doing something wrong or is it a bug? I'm on these versions, server hosted on Fly: ``` Client version: v25.9.0 Server version: v25.9.0 ``` Regex to edit note fields with "((To John Doe Dinner))" to just "Dinner": `{{regex notes "^\s*(?:((\s*)?[Tt]o\s+(.+?)\s+(\S(?:.\S)?)\s(?:)))?\s*$" "$2"}}` <img width="887" height="370" alt="Image" src="https://github.com/user-attachments/assets/337f7ef4-a2ac-42cb-9f46-995d1f4dcfe9" />
Author
Owner

@Dlougach commented on GitHub (Oct 17, 2025):

I think it would be nice to allow rules that are based on the original transaction object (i.e. JSON from GoCardless). A usecase I have in mind is to have name of the cardholder (from additionalDataStructured.Name) appended to the notes

@Dlougach commented on GitHub (Oct 17, 2025): I think it would be nice to allow rules that are based on the original transaction object (i.e. JSON from GoCardless). A usecase I have in mind is to have name of the cardholder (from `additionalDataStructured.Name`) appended to the notes
Author
Owner

@sharkykh commented on GitHub (Nov 5, 2025):

Edit: Fixed by 98174089c9.


Hi,
I'm not getting a correct value for the new balance variable added in v25.11.0.

Screenshots
Account Rule (Schedule)
Image Image

I'm using a non-repeating schedule to test, and the balance value is always 0, regardless of the actual balance.
Attached is an export of a minimal test case that didn't work for me (using a new database).

2025-11-04-rt-balance-test.zip

@sharkykh commented on GitHub (Nov 5, 2025): **Edit:** Fixed by https://github.com/actualbudget/actual/commit/98174089c9fb7d44a3166fbcb7b592a153898f1b. --- Hi, I'm not getting a correct value for the new `balance` variable added in v25.11.0. <details> <summary>Screenshots</summary> <table> <tr> <td>Account <td>Rule (Schedule) <tr> <td><img width="auto" height="200" alt="Image" src="https://github.com/user-attachments/assets/b2e479db-ce10-4830-a5a8-2c337147ba40" /> <td><img width="auto" height="200" alt="Image" src="https://github.com/user-attachments/assets/cc149747-80d6-4b2f-b658-0a0a378fd02f" /> </table> </details> I'm using a non-repeating schedule to test, and the balance value is always 0, regardless of the actual balance. Attached is an export of a minimal test case that didn't work for me (using a new database). [2025-11-04-rt-balance-test.zip](https://github.com/user-attachments/files/23357596/2025-11-04-rt-balance-test.zip)
Author
Owner

@zmasterar commented on GitHub (Nov 5, 2025):

Hi, I'm not getting a correct value for the new balance variable added in v25.11.0.
Screenshots
Account Rule (Schedule)
Image Image

I'm using a non-repeating schedule to test, and the balance value is always 0, regardless of the actual balance. Attached is an export of a minimal test case that didn't work for me (using a new database).

2025-11-04-rt-balance-test.zip

The same thing happens to me. I tried it with a repeating schedule and got the same result.

@zmasterar commented on GitHub (Nov 5, 2025): > Hi, I'm not getting a correct value for the new `balance` variable added in v25.11.0. > Screenshots > Account Rule (Schedule) > <img alt="Image" width="auto" height="200" src="https://private-user-images.githubusercontent.com/10238474/510070648-b2e479db-ce10-4830-a5a8-2c337147ba40.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjIzNDA4NDYsIm5iZiI6MTc2MjM0MDU0NiwicGF0aCI6Ii8xMDIzODQ3NC81MTAwNzA2NDgtYjJlNDc5ZGItY2UxMC00ODMwLWE1YTgtMmMzMzcxNDdiYTQwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTExMDUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUxMTA1VDExMDIyNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWYyODNjZjAxMDdjMzhkNTI4MDVmYmIzYjVlM2YwNzJhNGE5Nzg4MTEwY2ZlMDZlNjRjZGI4ZDZiN2RhNjFhOWMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.G6THG2QXUsnFDPlsN2whupFd-kdFevNMyR7_XnCiZuM"> <img alt="Image" width="auto" height="200" src="https://private-user-images.githubusercontent.com/10238474/510070649-cc149747-80d6-4b2f-b658-0a0a378fd02f.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjIzNDA4NDYsIm5iZiI6MTc2MjM0MDU0NiwicGF0aCI6Ii8xMDIzODQ3NC81MTAwNzA2NDktY2MxNDk3NDctODBkNi00YjJmLWI2NTgtMGEwYTM3OGZkMDJmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTExMDUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUxMTA1VDExMDIyNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNmMTczYTU2ZDE3ZjkyYTk4NmUwYjc1ODIxOTU0NjY2ZmEyOWQ0ZWM0OTYwOWFmNDRlMTI4ZDI3NmU2YjQxOTcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.U3kJXFBBiIql3UDB7fXSxFWFOUWQ5UJHRJeD8LYfdJg"> > > I'm using a non-repeating schedule to test, and the balance value is always 0, regardless of the actual balance. Attached is an export of a minimal test case that didn't work for me (using a new database). > > [2025-11-04-rt-balance-test.zip](https://github.com/user-attachments/files/23357596/2025-11-04-rt-balance-test.zip) The same thing happens to me. I tried it with a repeating schedule and got the same result.
Author
Owner

@sys044 commented on GitHub (Nov 14, 2025):

@sharkykh @zmasterar looks like it was broken by this change. I've let them know

@sys044 commented on GitHub (Nov 14, 2025): @sharkykh @zmasterar looks like it was broken by [this change](https://github.com/actualbudget/actual/pull/5985#issuecomment-3532524060). I've let them know
Author
Owner

@Mikhail773 commented on GitHub (Dec 4, 2025):

I would also think there would be tremendous benefit in allowing balance variable to specify which account to work with. The reason for this is simple. If you calculate a mortgage payment ( Pay from Savings to Lender and the principal to a House Account(Off Budget)) you want to have the savings be the accounts and the lender/house be the payees. Otherwise, you would never even be able to have a rule with a split transaction since accounts would differ. Currently I am having both set to account as House and trying to change the account of Interest to savings after the fact. Finding that in the future transaction it looks correct, but then on posts it overrides the account to house again

@Mikhail773 commented on GitHub (Dec 4, 2025): I would also think there would be tremendous benefit in allowing balance variable to specify which account to work with. The reason for this is simple. If you calculate a mortgage payment ( Pay from Savings to Lender and the principal to a House Account(Off Budget)) you want to have the savings be the accounts and the lender/house be the payees. Otherwise, you would never even be able to have a rule with a split transaction since accounts would differ. Currently I am having both set to account as House and trying to change the account of Interest to savings after the fact. Finding that in the future transaction it looks correct, but then on posts it overrides the account to house again
Author
Owner

@AntoninoBonanno commented on GitHub (Jan 8, 2026):

Is it possible to filter specifically on a variable? For example, I'd like to set the balance between two dates relative to today's date. Specifically, I'd need the entire month prior to today.

Related: #6598

@AntoninoBonanno commented on GitHub (Jan 8, 2026): Is it possible to filter specifically on a variable? For example, I'd like to set the `balance` between two dates relative to today's date. Specifically, I'd need the entire month prior to today. Related: #6598
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#1487