Value-Based Rules

Modified on Mon, 3 Nov at 1:53 PM

Rules Definition

Rules in the system are logical conditions that return True or False based on an Order’s field values. They can be leveraged to control notifications, apply fuel surcharge schedules, and create automation logic.


Types of Rules

There are two types of Rules available:

  • Script Rules – Created using an Order Rule Script.

  • Value-Based Rules – Built by verifying field values in an Order.

Use Cases:

  • In Notification Templates, Rules determine whether a notification is sent based on the Rule outcome (True/False).

  • In Fuel Surcharge Schedules, different surcharge tables can be applied depending on Order field values.


Creating a Value-Based Rule

  1. Navigate to Rules Setup

    • Go to Settings > Configurations > Orders > Rules.

  2. Create a New Rule

    • Click New Order Rule.

    • Enter the Rule Name and optional Description.

    • In Type, select Value-Based.

  3. Build the Rule

    • Under Values, add filters and groups to define conditions.

    • Use logical operators:

      • AND – All conditions must be True.

      • OR – At least one condition must be True.

    • Use Groups when you need multiple sets of filters with different operators.

    • Available filters include:

      • Order Account

      • Vehicle

      • Service Level

      • Reference Field values

      • Hold Reason

  4. Tip: If you need more than one set of filters, add a Group first, then define how all Groups interact (AND/OR).

  5. Save the Rule

    • Once configured, click Save to finalize.


Examples

Example 1: Simple Value-Based Rule

Scenario: Send a notification for ASAP Orders where an Address does not exist.

  • Add filters for:

    • Service Level = ASAP

    • Hold Reason = Address does not exist

  • Set operator to AND (both must be True).

Result: The Rule triggers only when both conditions are met.


Example 2: Complex Value-Based Rule

Scenario: Extend the previous Rule to include another case: Same Day Orders refused by the occupant.

  • Group 1:

    • Service Level = ASAP

    • Hold Reason = Address does not exist

    • Operator: AND

  • Group 2:

    • Service Level = Same Day

    • Hold Reason = Refused by occupant

    • Operator: AND

  • At the top level, set operator to OR.

Result: The notification is triggered if either Group 1 OR Group 2 evaluates as True.


Operators

The available operators depend on the selected filter:

  • Defined Values (Account, Service Level, Vehicle, Hold Reason):

    • is equal to

    • is not equal to

  • Reference Fields:

    • A broader set of operators is available (e.g., contains, does not contain, starts with, etc.).


✅ By using Rules, you can customize system behavior, ensure targeted notifications, and apply business logic seamlessly.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article