↑↓ selectEnter openEsc close

    1. Elbuz

    How to choose an event and set a rule condition

    4 min readUpdated

    Elbuz runs a rule's commands only when the selected event happens and the record matches the condition. The event answers “when to check”, the condition — “is this record ours”.

    When you need this:

    • Email only for customer orders — a document type condition filters out other documents.
    • React to a status change, not every save — the “Initial value” item catches the change.
    • Payment reminder three days after the due date — a date placeholder counts the period.
    • Repeat the reminder daily — “Check interval” allows repeats for the same record.

    Where to start: “Automatic rules” → “Add” → choose an event.

    What events and conditions can do

    • Twelve events — creating, saving and posting a document, contact changes, approval of an AI agent request.
    • Overdue payment — an event from the system schedule every 32 minutes, with no action by a person.
    • Condition builder — a field, an operator and a value from the fields of your document or contact list.
    • Date placeholders — “today minus three days” instead of a specific date.
    • “Initial value” — fires exactly when a field changes.
    • “Check interval” — once per record, or a repeat no more often than the period you set.

    Events you can attach a rule to

    There are twelve events. Six are about contacts, five about documents, and one about approval of an AI agent request.

    Full list of events
    Event in the listWhen it's raised
    Contact: adda contact card is created
    Contact: savea contact card is saved
    Contact: deletea contact is deleted — the card moves to the Trash and stays available to the rule
    partner: addan external system creates a contact via the API
    API partner: savea contact is saved via the API
    API partner: deletea contact is deleted via the API
    Document: adda document is created, including an order from the website
    Document: updatea document is saved; an order changes during import (tunnel, marketplaces, API v2); plus, every 32 minutes the system schedule goes through unposted documents from the last 30 days
    Document: deletethe item is in the list, but a rule on it doesn't work: by the time of the check, the document is no longer in the database
    Document: post (sign)a document is posted or unposted
    Document: payment overdueonly from the system schedule, every 32 minutes
    AI agent: approval executedafter a person approves an AI agent's data-change request; this event is offered only in the window opened from “Message templates”, and a rule created there has no condition (why)

    Overdue payment is a special case

    This event doesn't come from a person's action: the system schedule creates it every 32 minutes. It takes documents whose “Pay by” date has passed, but no more than 90 days ago, and that have no payment date — up to 300 documents per run, newest first.

    In the same run, the schedule goes through unposted documents from the last 30 days — also up to 300 of the newest — and raises “Document: update” for them.

    This is a row in the account's system schedule, and you don't need to create it — it's already there. But if the schedule is turned off in the account, the event won't come at all: neither for overdue payments nor for unposted documents.

    When you create a rule specifically for overdue payment, the app immediately adds a sample condition to it: “Pay by” less than {current_date}. You can leave it as is or rewrite it to suit you.

    A rule is created already turned on. A schedule is the opposite: it's created off and waits for your checkbox. So “created a rule → went for coffee → came back to set up the condition” is risky: without a condition, the rule fires on every event. Until it's ready, turn off the “Active” toggle in the card's first section.

    Condition: what exactly is checked

    You build a condition in the builder: a field, an operator, a value — and as many rows as you like, joined by “and” or “or”. Below the builder, the app spells out what you've built in plain words, so you can reread it and make sure you got exactly what you meant.

    The Condition section of the trigger card: condition builder, plain-words summary, expanded date placeholder tip and the Clear condition / Save condition buttons
    1Condition builder row
    2Plain-words summary
    3Save condition button
    1. Condition builder row — a field, an operator and a value together make up one condition.
    2. Summary strip — shows in plain words what the condition turned out to be.
    3. Save condition — the condition is saved only with this button; the other card fields save on their own.

    The list of fields comes from your document or contact grid. That's hundreds of fields, including your custom ones, but there's a flip side: for an employee who has never opened the relevant list, the builder will be empty. The fix is simple — open the list, set up the columns and go back to the rule.

    Operators depend on the field type:

    • number — equal to, not equal to, less than, less than or equal to, greater than, greater than or equal to, between;
    • date and text — all of the above plus empty string, non-empty string, contains, does not contain;
    • document status, payment status and method, delivery status and method, contact group, language, currency — equal to, not equal to, one of the specified, not one of the specified, with a list of ready-made values;
    • warehouse, company and document type — equal to, not equal to, empty string;
    • yes/no — only equal to, with a list of “yes” and “no”.

    The condition sees stock levels of document items only in the “Document: post (sign)” event: the “Product quantity in stock” field appears there. Other events have no such field.

    Date placeholders

    In a condition value, you can write a placeholder instead of a specific date, and the app replaces it at the moment of the check. There are three: {current_date}, {current_datetime} and {current_time}. You can add an offset to each: a plus or minus sign, a number and a unit — minute, hour, day, week, month, year.

    In the app, these samples sit under “Tip: date placeholders in conditions”; click a sample to copy it. An example from the tip: the condition “Pay by” less than {current_date-3day} means “more than three days overdue”.

    “Initial value” — reacting to a change

    The value lists for document, payment and delivery statuses, payment and delivery methods, warehouse, company, language and currency have a separate “Initial value” item. It works only together with the “not equal to” operator and reads as “the field is no longer what it was before saving”. So the rule fires on a change, not on every card save.

    This item has a second, less obvious effect: when the value really has changed, the app clears the trigger log for that record. So a rule with “Initial value” can fire for the same document again and again — every time the field changes.

    The condition is saved with a separate “Save condition” button below the builder. Other card fields — title, note, the “Active” toggle, “Check interval” — save themselves as soon as you leave the field. So it's easy to build a condition, close the window and keep the old condition: the title was saved, the condition wasn't.

    Next to it is “Clear condition” — it removes all rows from the builder, but the database keeps the old condition until you click “Save condition”.

    Once per record — and never again

    This is the most common source of the question “the rule is on, but there's no email”. The app keeps a separate trigger log: for each “command + record” pair, it remembers that it has already run. The command won't run a second time for the same document.

    This behavior is controlled by the “Check interval” field in the first section of the card and the neighboring “Unit” field with the values: seconds, minutes, hours, days, weeks, months, quarters, years.

    • 0 — the value a rule is created with. It means “no repeats”: one command, one record, once in the rule's whole lifetime.
    • Above zero — a log entry older than the set period is deleted, and the command can run again. “1 day” reads as “no more than once a day per record”.

    The third way to get a repeat is a condition with the “Initial value” item: when the field really has changed, the log for that record is cleared completely.

    Scenarios

    • One email for each new order — the “Document: add” event, the condition “Document Type” equal to “Customer order”, “Check interval” 0. Full walkthrough: confirmation email.
    • A daily reminder until the invoice is paid — the “Document: payment overdue” event, “Check interval” 1 day. Full walkthrough: payment reminder.
    • An SMS only when the status has changed — the condition “Document status” not equal to “Initial value” and equal to the status you need. Full walkthrough: SMS by status.
    • A review request three days after shipment — the “Document: update” event, a condition with a date placeholder, “Check interval” 0: the reminder should go out once.

    What to do when a rule doesn't react

    Symptom, cause and what to do
    What you seeWhyWhat to do
    The rule is on, the event happened, the log is empty Most often, the command already ran for this record earlier, and “Check interval” is zero Set “Check interval” above zero or add the “Initial value” item to the condition (about repeats)
    The “Condition” section has no fields to choose from The list of fields comes from your document or contact grid, and you haven't opened that list yet Open the relevant list, set up the columns, go back to the rule (about the condition)
    You built a condition, closed the window — the condition is the old one The condition is saved with a separate button, the other card fields are saved on their own Click “Save condition” below the builder (about the condition)
    The overdue payment condition is set, but the rule stays silent This event comes only from the system schedule, every 32 minutes, and only for documents whose “Pay by” date passed no more than 90 days ago and whose payment date is empty. Per run, the schedule takes up to 300 such documents, newest first Check that the payment really isn't entered and the due date passed no more than 90 days ago (about overdue payment)
    “The condition was not saved: it has a field, operator or value the builder does not accept. Reopen it and save again.” — followed by the reason in brackets It appears for any condition parsing error: an expression instead of a listed field in the left column; an operator the builder doesn't know; only one of the two “between” values is filled in; groups are joined by something other than AND/OR; the condition is damaged. Almost always it's a condition saved by an older version of the app Close the card, open it again, delete the odd rows, rebuild them with fields from the list, fill in both “between” values and click “Save condition”. Compare dates with a placeholder in the value: “Pay by” → less than → {current_date-3day}

    FAQ

    Can I change the event in an existing rule?

    No. The event is chosen once, when the rule is created, and you can't change it in the rule card. If you need a different event, create a new rule.

    Why didn't an order added manually get an email from the rule on adding?

    The create event raised by adding a document manually from the document list carries no document number, so the rule skips that record. An email from “Document: add” goes out for orders imported from the website.

    Why does a rule on “Document: delete” do nothing?

    By the time of the check, the document is no longer in the database. For a contact, this event works: the card moves to the Trash and stays available to the rule.

    Can I catch a warehouse or company change with “Initial value”?

    Yes. The condition “Warehouse” or “Company” → “not equal to” → “Initial value” fires when the warehouse or company in the document has been changed (about “Initial value”).

    Why is there no reminder for an invoice that became overdue six months ago?

    The system schedule takes only documents whose “Pay by” date passed no more than 90 days ago. Older ones drop out of the filtered set.

    Where to find it and who has access

    Rules have no menu item: the window opens from the document or contact list (all entry points).

    Event
    “Automatic rules” → “Add” → list of events
    Condition
    rule card → “Condition” section
    Access right
    the “Automatic rules” window with the edit right

    Related topics

    Was this article helpful?

    Missing a feature? Tell us.

    We will add it for free if other users need it too.

    If only you need it, we will agree on it separately.

    Article contents

    Suggest an improvement

    Try Elbuz free