-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feedback] Rule action templating #3606
Comments
Some additional variables I would appreciate being added are:
|
I think these could best be added as helper functions. Especially the second one. |
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! 😃 |
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. |
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: To everyone interested, the following rule template will move the transaction to the first of the next month (including changing the year):
|
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:
Template mode:
Then enter your template. For example, the below will replace the notes field with the VAT paid (standard VAT is 20% in the uk)
At the moment, templating is supported for setting:
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)Full list of available variables that can be used
today (date)
account (id)
amount (number)
15200
.{{div amount 100}}
can be used to convert backcleared (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.
The text was updated successfully, but these errors were encountered: