Conditions
The trigger identifier decides which events a subscription listens to. Conditions decide whether it should act on this particular one.
You'll find them on the Business logic card of the subscription's detail page, under the Conditions tab. They're optional: a subscription with no conditions runs every time its event happens.
Why you'd use them
An event is usually broader than what you want to automate. Some examples:
- "Every invoice was updated" → only act when the status became Approved.
- "A record of this kind was created" → only act when it belongs to a particular customer.
- "A port visit's ETA changed" → only act for ships above a certain size.
Conditions let one event serve many different automations, each with its own filter, instead of needing a separate event for every case.
How a condition is built
Conditions here work exactly like the business logic used elsewhere in SHIPM8, so the Business logic — basics page is the reference for the mechanics. In short, each condition has:
- a source field — which value to look at, written as a path into the event's data;
- an operator — how to compare (equals, greater than, contains, and so on);
- a value — what to compare against.
The kinds you can choose from are the same set: text, numeric, yes/no, date and list, plus the more advanced timespan and schedule conditions.
If you add several conditions they all have to hold. To express "either this or that", use evaluation sets, described under Business logic — advanced.
What the conditions look at
The difference from tariffs is only what the conditions are looking at. Here the data is the event message, which carries:
- the record the event was about, as it is now;
- for updates, the record as it was before, and the list of fields that changed;
- the moment the event happened.
That means a source field is a path into that record's data — the same kind of field path you use when writing a template.
The safest way to work out a field path is to look at the data that actually arrived. Add an Admin notification action first (see Action types), let the event happen once, and read what comes through — then write your conditions against that. SHIPM8 support can also pull up the recorded event data for you.
Adding one
Click Edit on the subscription first, then Add on the Business logic card. Pick the kind of condition, fill in the source field, operator and value, and confirm. Click an existing condition in the list to change it. Nothing is stored until you Save the subscription.
On a subscription the card shows only the Conditions tab — the calculation, dependency and VAT tabs you may know from the tariff screens don't apply here.