Date operators
Description of date operators used in decision tables
Last updated
Description of date operators used in decision tables
Last updated
In each condition cell of a decision table, you have the flexibility to apply a variety of operators depending on your needs. These operators enable you to compare and manipulate date and time values effectively, ensuring that your conditions are evaluated accurately. You can choose from a range of operators, whether for simple equality checks or more complex comparisons involving date ranges. The full list of available operators can be found in the operators modal:
When working with date operators in decision tables, using the correct format is crucial for ensuring accurate comparisons. Each condition cell can have a distinct operator for handling dates, but it’s important to understand how dates function within DecisionRules and how to correctly enter values into the cell.
You have two ways to input the date:
Manually entering the date directly into the cell (recommended)
Using the date picker
Let’s explore both methods.
You can now enter the date directly into the cell (this was previously only possible using the date picker). After selecting the desired date operator, click the cell, which is now set to accept date input with enhanced functionality. When you start typing, a hint will appear displaying the recommended date format:
We highly recommend always including the timezone (GMT) for accurate date interpretation.
The cell will also show how your date is interpreted in real-time through a whisper. For example, if you enter 2024-09-24 09:24 +02:00, the whisper will display the interpreted date as "September 24, 2024, at 9:24:00 AM GMT+2." This allows you to ensure that the date you’ve entered is correct.
Date cells provide validation feedback, alerting you to any issues with date interpretation. There are two primary validation messages:
Invalid Date This message indicates that the input value is not recognized as a valid date. The operator will not be able to process the value, and you will need to correct it.
Date Doesn't Fit Format This message means the input does not follow the recommended format (e.g., using slashes like 2024/09/24 or omitting the timezone), however, the system can still interpret the date. The whisper will show how the date is interpreted.
We strongly advise sticking to the suggested format to ensure full functionality of the date operators.
If you prefer to select the date visually, the date picker functionality is still available. To use the date picker, hover over the date cell, and a calendar icon will appear at the end of the cell:
Clicking the icon will open a modal where you can choose the date. By default, both the date and time are set to None, and the timezone is pre-set to GMT. You can adjust these settings if needed. Click the desired field, choose the Select Date or Select Time option, and either enter the date and time manually or click the next calendar icon:
After choosing the date, click the Submit button and save the changes by pressing Save.
The selected date will be set in the date cell in the recommended format, just as if you had entered it manually.
If you change your mind while setting the date or time in the modal, you can unselect the Select Date or Select Time option to clear the value. Alternatively, you can delete the value directly in the date cell.
In DecisionRules, you are not limited to explicitly setting a date in the date cell. Like other cells, date cells also support variables, such as:
Input values
Calculation column variables
For more information on variables, refer to the Table Designer: Special Case — Variable Values section
To use a variable, start typing the "{"
symbol in the date cell, and a dropdown list of available variables will appear. When a variable is used in a date cell, the Dynamic Date warning will be visible in the active date cell:
Please note that date cells cannot validate the date passed through a variable. Ensure the date provided in the variable has the correct format.
Dates are now saved as strings. To match a condition like 2024-09-24 09:27 +02:00
, the request must contain the same string format: "2024-09-24 09:27 +02:00"
. Additionally, we support the Extended ISO8601 Date format, so the condition will also match the string "2024-09-24T09:27:00+02:00".
The old object format is deprecated but still supported. This means you can still pass a request using the old format, like so:
This will still match the 2024-09-24 09:27 +02:00 condition.
The equals (=
) operator compares the request date and time value with the table date value, including the time zone.
The not equal (!=
) operator returns true
if the request date string and the table date string differ in any way.
The greater than (>
) operator checks if the request date string is later than the table date string.
The less than (<
) operator returns true
if the request date string is earlier than the table date string.
The greater than or equal (>=
) operator checks if the request date string is either later than or exactly the same as the table date string.
The less than or equal (<=
) operator returns true
if the request date string is earlier than or exactly the same as the table date string.
The between (BTW
) operator checks if the request date string falls within the range of two table date strings, inclusive of both the start and the end values.
The not between (!BTW
) operator checks if the request date string falls outside the range of two table date strings, returning true
if the value is not within the range.