The condition builder is a tool that allows users to create condition statements to further filter records. The condition builder is available to users on list views as well as on forms that contain the Condition fields.
The condition builder helps users to filter lists, create ACL and business rules, and others.
Condition format
The condition consists of three parts:
- Field
- Operator
- Value
The Field part is a choice list that consists of table columns. You can navigate to the columns of the related tables using dot-walking.
The Operator part is a choice list that consists of different sets of operators. The sets depend on a field type. For example, in the Task table, you cannot apply the greater than operator to the Active field, since it is a field of True/False type. But you can use this operator to any field of number type.
The Value part is a text field, a set of text fields, or a choice list, depending on a chosen field and operator. For example, for the Active field of Boolean type, the value area will be displayed as a choice list with the options false and true. For the Description field, the value area is an input text field.
You can use the following symbols in the value field: * + ? / \ | < > , . ( ) [ ] { } ; : ' " ! @ # $ % & = ~ –
, except ^
.
REM attributes
The condition builder supports record filtering with the use of REM attributes. You can choose a model related to the selected table and build a criterion with an attribute from this model and an operator corresponding to the attribute type. The field and attribute search filter also allows you to find a specific model as the set of attributes.
When using the condition builder with tables that include REM attributes, additional options are available below the search field:
Use the filter selector to narrow down the search results:
- Click All to include both regular fields and REM attributes in the search results.
- Click Fields to only search for regular fields.
- Click Models to only search for models used in the selected table.
When you input a value into the search field, the Attributes filter is added:
- Click Attributes to search for REM attributes used in the current table.
The models are marked with the M icon.
Click the model name to expand or collapse it.
After you select an attribute, its model is shown in the condition field:
When you build complex AND/OR conditions, take into account the logic rules of filtering. The AND operator returns an empty sample if the attributes belong to different models, while the OR operator returns the records that meet the conditions of any attributes.
Condition builder actions
Click the funnel sign to open the condition builder toolbar.
- AND – tells the database that search items must contain the condition. If you apply two or more conditions with AND, you will see only those records that meet all of these conditions.
- OR – tells the database that any of the specified conditions will be acceptable. You can add high-level conditions using these buttons in the condition builder toolbar. If you apply two or more conditions with OR, you will see the records that meet at least one of these conditions.
Other available actions:
- Sort – adds conditions of the fields sorting in descending and ascending order.
- Group – adds conditions of the fields, grouping and sorting in descending and ascending order by Name and Count. The action is only available on lists.
- Save – saves the configured conditions. Before saving, be sure to enter the name for the filter. The action is only available on lists.
- Run – runs the configured condition to apply the filter. It is only available on lists.
- Close – hides the condition builder. The action is only available on lists.
- Clear All – deletes defined conditions.
Breadcrumbs
In SimpleOne, the breadcrumb navigation is an element of the interface that display all applied conditions for filtering. You can see the breadcrumbs above the condition builder toolbar, near the funnel sign.
You can reset applied conditions by clicking arrows to delete unnecessary filters.
To delete all filters but one, you need to click the filter that you need to keep.
Quick filtration
Show Matching, Filter Out, and Group By are three quick ways to filter elements. After applying one of these filters, you can also add more conditions in the condition builder toolbar or by applying actions Show Matching, Filter Out, and Group By one more time. You can see all applied conditions in the breadcrumbs.
It is convenient to use Quick Filtration if you need to apply one condition without any details. See List Interface to learn more.
Condition string
The condition string describes conditions that are applied to the table fields with the AND and OR operators. It is generated automatically by the condition builder. It is used in the URL in the condition parameter, after the list is filtered. Also, it can be created manually in scripts. Some symbols in the condition string can be encoded by the browser.
The condition string does not contain the table name related to this condition. So when using it, take the table to filter out into account.
The condition string is shown below:
a0^a1^a2^...^an, or a0^ORa1^ORa2^OR…^ORan
Where ai – are the condition strings bracketed.
Special symbols
Symbol | Description |
---|---|
^ | AND operator |
^OR | OR operator |
^ORDERBY | The ascending sorting |
^ORDERBYDESC | The descending sorting |
@ | Values delimiter in the <values> section |
^GROUPBY | The ascending grouping by values |
^GROUPBYDESC | The descending grouping by values |
^GROUPBYCOUNT | The ascending grouping by number of records |
^GROUPBYCOUNTDESC | The descending grouping by number of records |
=OP | Opening parenthesis |
=CP | Closing parenthesis |
The complex expressions can be built using AND/OR operators; to prevent collisions, elementary expressions inside the complex one are bracketed.
JavaScript injections
The Value field also supports so-called JavaScript injections. You can specify a JavaScript short script in case the Value field is of one of the text input types. This scenario will be interpreted, and its results will be returned as a filter value.
To use this functionality, add a JS injection into the Value field in the following format:
javascript: script_text
The field supports commas (,) and line breaks (\n).
You can also use include scripts in these injections. To use an include script, follow instructions in the Script Include article. The maximum length of the script is limited up to 255 symbols.
The example of include script in injections is provided below:
javascript: ss.importIncludeScript('DateTimeScript'); return getWeekStartDate();
- No labels