You are here:
How Null Values Work in Decision Tables
How decision tables treat null and blank input cells depends on the table type. In standard decision tables, use the Consider Null Values for Lookup option to control how rows with null values are matched during lookup. In advanced decision tables, Consider Null Values for Lookup isn't supported. Blank cells in optional input columns always act as wildcards and match any supplied value.
Required Editions
When you turn on Consider Null Values for Lookup, rows with null values in the decision table are matched only when the input explicitly includes null, which ensures precise matches. When you turn off this option, a null input returns a match for any value in the column, not just rows with an explicit null.
| Available in: Lightning Experience |
| Available in: Enterprise, Unlimited, and Developer Editions for clouds that have Business Rules Engine enabled |
How null and blank input cells affect matching depends on whether you use a standard or an advanced decision table. Review the section for your table type.
Standard Decision Tables
| INPUT | OUTPUT | ||
|---|---|---|---|
| Product | Payment Type | Price | Discount |
| A | one-time | 1000 | 5 |
| B | null | 500 | 10 |
| B | one-time | 500 | 15 |
| Product | Payment Type | Price | Output with Consider Null Values for Lookup Enabled | Output with Consider Null Values for Lookup Disabled |
|---|---|---|---|---|
| A | one-time | 1000 | 5 (first row is an exact match) | 5 (first row is an exact match) |
| B | null | 500 | 10 (second row matches explicit null in input) | 10 and 15 (second and third rows match the product and price columns, and null matches all values in the payment type column) |
| A | null | 1000 | No output values (first row's 'one-time' doesn't match explicit null) | 5 (first row matches the product and price and null matches all payment type values) |
| B | one-time | 500 | 15 (third row is an exact match) | 15 (third row is an exact match) |
Advanced Decision Tables
Consider Null Values for Lookup isn't supported for advanced decision tables. That option applies only to standard decision tables. Advanced decision tables always treat blank cells in optional input columns as wildcards.
Blank optional cells act as wildcards. If an optional input column's cell is blank (null), that condition evaluates to true for any value you supply for that column. The row can still match as long as its mandatory conditions are met.
Wildcards satisfy OR groups. If your condition logic includes an OR group, for example
1 AND 2 AND (3 OR 4), a blank wildcard branch in that OR group makes the
whole group evaluate to true. The row matches as long as the mandatory, non-OR-group
conditions hold.
First Match uses row order, not specificity. When Filter Result By is set to First Match, the table evaluates matching rows in table order and returns the first match. It doesn't rank rows by how specific they are, so a wildcard row authored above a more specific row wins. To give a specific row precedence over a wildcard row:
- Place more specific rows above any catch-all or wildcard row.
- Add explicit values to the optional cells on specific rows instead of leaving them blank.
- Put the intentional blank catch-all row last.
- If you apply a Sort By setting, sort so that specific rows precede wildcard rows — sorting changes the row order the table evaluates, so it changes which row wins.
1 AND (2 OR
3), where condition 1 (Product) is required, and conditions 2 (Region) and 3 (Tier)
are optional.| INPUT | OUTPUT | ||
|---|---|---|---|
| Product (Required) | Region (Optional) | Tier (Optional) | Discount |
| Widget | 5% | ||
| Widget | West | Gold | 15% |
Null Values vs. Empty Strings in CSV Decision Tables
When you create or edit a decision table by using a CSV file, Business Rules Engine treats empty cells as null. If you add the string "null", it's treated as an invalid value. In case of boolean values, an empty input is treated as false.
Consider a decision table with these CSV rows for the Payment Type column.
| Product | Payment Type (cell value in CSV) | How Business Rules Engine Interprets the Value |
|---|---|---|
| A | one-time | Treated as the string one-time. |
| B | (empty cell) | Treated as a null value. |
| C | null | Treated as an invalid input. |
