Condition Builder Options
The condition builder options allow you to create and use dynamically predefined values for the specified types of columns, fields, tables, or condition operators.
The main use case of this functionality is filtering by fields of Date/Time type. The options facilitate filtering by using predefined values, such as "Yesterday", "Week before", "Next Month" and others.
In the URL, options are displayed as opt:{option_id}
.
Create an option
To create a new option, complete the steps below:
- Navigate to System Settings → Condition Builder → Options.
- Click New and fill in the fields.
- Click Save or Save and exit to apply the changes.
Option form fields
Field | Mandatory | Description |
---|---|---|
Title | Y | Specify the option name. It will be displayed in the condition builder values choice list. |
Field Type | N | Specify a column type to which this option is applicable. If not specified, then the option will be applicable to all field types created in the system. |
Refer to Table | N | Specify the table that the selected field in the condition builder will refer to. This field appears when the Field type is Reference or List. |
Use for Field | N | Specify a field to which this option is applicable. If not specified, then the option applies to all columns. |
Use in Tables | N | Specify tables to which this option is applicable. You can specify more than one table. If not specified, the option applies to all tables. |
Use with Operators | N | Specify condition operators to which this option is applicable. You can specify more than one type. If not specified, the option applies to all operators supported. To find a list of operators supported by options, navigate to System Settings → Condition Builder → Operators. To add new operators to this list, contact the vendor. |
Script | N | Specify a script implementing the option logic. |
Active | N | Select this checkbox to make the option active. If not selected, this option is not displayed in the condition builder values choice list. |
Order | N | Specify an option order. If multiple similar options are created, they will be applied according to the specified value in ascending order. |
You can use Script Includes when defining option logic. To do so, complete the following steps:
- Create a script include.
function getDateWeekAfter() {
const simpleDateTime = new SimpleDateTime();
simpleDateTime.addDays(7);
return simpleDateTime.getDate();
}
- Import it using the ss.importIncludeScript(name) method.
ss.importIncludeScript('getDateWeekAfter');
setResult(getDateWeekAfter());