Trigger examples
Explore scenarios to gain insights into how to customize the conditions for approval policies with practical situations, and adapt them to fit the distinctive needs and goals of your organization.
Examples
On this page, we delve into a variety of real-world scenarios of conditions for triggering approval policies. These scenarios are designed to help you understand how approval policies can be automatically set to specific invoices and how to customize these conditions to address specific operational, compliance, and governance needs within your organization.
- The conditions mentioned on this page are designed using the MoniteScript and must be inserted into the
trigger
field. Check the Evaluated string section for further information about the syntaxes.- The
event_name
field is mandatory.- The
if
,then
, andelse
statements are not allowed into thetrigger
field.
By invoice amount
By invoice amount
Set an approval policy for all invoices worth more than 300 EUR:
{
"name": "By invoice amount",
"description": "Invoices worth more than 300 EUR",
"trigger": {
"all": [
"{event_name == ‘submitted_for_approval'}",
"{invoice.currency == 'EUR'}",
"{invoice.amount > 30000}"
]
},
"script": []
}
With specific currencies
With specific currencies
Set an approval policy for all invoices with specific currencies, in this case, EUR and USD:
{
"name": "With specific currencies",
"description": "Invoices with specific currencies",
"trigger": {
"all": [
"{event_name == 'submitted_for_approval'}",
"{invoice.currency in ['EUR', 'USD']}"
]
},
"script": []
}
With specific tags
With specific tags
Set an approval policy for all invoices containing one of the specific tags:
{
"name": "With specific tags",
"description": "Invoices containing one of the specific tags",
"trigger": {
"all": [
"{event_name == ‘submitted_for_approval'}",
{
"any": [
"{'Marketing' in invoice.tags.name}",
"{'Urgent' in invoice.tags.name}",
"{'d566f374-463a-4a07-b252-2eb0200d62ce' in invoice.tags.id}",
"{'398b2748-b255-46da-b8dc-a01219539ec9' in invoice.tags.id}"
]
}
]
},
"script": []
}
For specific counterparts
For specific counterparts
Set an approval policy for all invoices from a specific list of counterparts:
{
"name": "For specific counterparts",
"description": "Invoices from a specific list of counterparts",
"trigger": {
"all": [
"{event_name == ‘submitted_for_approval'}",
"{invoice.counterpart_id in ['398b2748-b255-46da-b8dc-a01219539ec8', '4d0ff737-070b-427a-980c-c8ee7961577d']}"
]
},
"script": []
}
For specific users
For specific users
Set an approval policy for all invoices from a specific list of users:
{
"name": "For specific users",
"description": "Invoices from a specific list of users",
"trigger": {
"all": [
"{event_name == ‘submitted_for_approval'}",
"{invoice.was_created_by_user_id in ['d566f374-463a-4a07-b252-2eb0200d62ce', '398b2748-b255-46da-b8dc-a01219539ec9']}"
]
},
"script": []
}
By amount, currency, tag, and specific counterpart
By amount, currency, tags, AND specific counterpart
Set an approval policy for all invoices worth more than 1000 EUR, from a specific counterpart AND with specific tags:
{
"name": "By amount, currency, tag, AND specific counterpart",
"description": "Invoices worth more than 1000 EUR, from a specific counterpart AND with specific tags",
"trigger": {
"all": [
"{event_name == 'submitted_for_approval'}",
"{invoice.amount > 100000}",
"{invoice.currency == 'EUR'}",
"{invoice.counterpart_id == '398b2748-b255-46da-b8dc-a01219539ec8'}",
"{'d566f374-463a-4a07-b252-2eb0200d62ce' in invoice.tags.id}",
"{'398b2748-b255-46da-b8dc-a01219539ec9' in invoice.tags.id}"
]
},
"script": []
}
By counterpart, plus amount OR specific tag
By counterpart, plus amount OR specific tag
Set an approval policy for all invoices from a specific counterpart worth more than $300 OR with a specific tag:
{
"trigger": {
"all": [
"{event_name == 'submitted_for_approval'}",
"{invoice.counterpart_id == '398b2748-b255-46da-b8dc-a01219539ec8'}",
{
"any": [
"{invoice.amount > 30000}",
"{'d566f374-463a-4a07-b252-2eb0200d62ce' in invoice.tags.id}"
]
}
]
},
"script": []
}
Updated 6 days ago