Condition Builder is a tool that allows creating conditions to collect fields formed dynamically and setting multiple conditions for specific request, depending on the context.

The Condition Builder helps users to filter lists, create ACL and Business Rules, etc. 

Condition format


The condition consists of three parts:

  • Field
  • Operator
  • Value.

Field is a choice list consisting of table fields. You can choose fields from the related tables using dot-walking.

Operator is a choice list consisting of different set of operators depending on a field type. For example, in the Task table, you cannot apply the greater than operator to the Active field, since it's a Boolean field. But you can use this operator to any field of a number type.

Value is a text field, or text field set, or a choice list, depending on a chosen field and operator. For example, for the Active field of a Boolean type, the value area will be a choice list with the options displayed: '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 attribute.

Condition Builder Actions


Click on the funnel sign  to call Condition Builder toolbar.

  • AND  – tells the database that search items should contain the condition necessarily. 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. Available on lists only.

  • Save – saves the configured conditions. Before saving, be sure to enter the name for the filter. Available on lists only.
  • Run – runs the configured condition to apply the filter. Available on lists only.
  • Close – hides the condition builder. Available on lists only.
  • Clear All  deletes defined conditions.

Breadcrumb Navigation 


In SimpleOne, Breadcrumb Navigation is an element of the interface that display all applied conditions for filtering. You can see Breadcrumbs above the Condition Builder toolbar, near the funnel sign

You can reset applied conditions by clicking on arrows  to delete unnecessary filters. 

To delete all filters but one you need to click on the filter that you want to keep.

Quick Filtration


Show MatchingFilter 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 MatchingFilter Out, and Group By one more time. All applied conditions you can see in Breadcrumbs Navigation.

It is convenient to use Quick Filtration, if you need to apply one condition without any details. Use Condition Builder toolbar, if you need to apply several conditions with details.

  • Show Matching – displays elements that contain the same parameter. It corresponds with positive and AND operators.
  • Filter Out – eliminates all elements with one certain parameter. It corresponds with negative operators, for example, is notdoes not, etc.
  • Group By – collects all elements with the same parameters. As a result, you will see groups based on the condition and the number of elements in each group. It is the same operator as Group in Condition Builder toolbar. You can navigate to each group to see the records and also Open a group in the list

To process the filtering, please complete the steps below:

  1. Navigate to the list you need. 
  2. Right-click on the value of any field and open the context menu.
  3. Select the necessary action.

 

Condition String


Condition string describes conditions, applied to the table fields, combined with the AND and OR operators. It is generated automatically by the condition builder. It can be seen in the URL in the condition parameter, after filtering the list. Also, it can be created manually in scripts.

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 represented as described below:

a0^a1^a2^...^an,  or a0^ORa1^ORa2^OR…^ORan

Where an – are the same condition strings bracketed.

Special symbols

SymbolDescription
^AND operator.
^OROR operator.
^ORDERBYThe ascending sorting.
^ORDERBYDESCThe descending sorting.
@Values delimiter in the <values> section (see the Node conditions section in this article for more information).

The complex expressions can be built using AND/OR operators; to prevent collisions, elementary expressions inside the complex one are bracketed.

Node conditions


The node conditions can be represented like described below:

<attribute><operator><values>

<attribute> – the table attribute (that is system name of the field). Dot-walking attributes can be used, for example, assigned_user.id.company.name.

<operator> – the operator available to use with the selected <attribute>.

<values> – the set of the values (operands) divided by "@".

JavaScript injections

The <values> field also supports so-called JavaScript injections, so you can specify a JavaScript short scenario in case the <values> field is of one of the text input types. This scenario will be interpreted, and its results will be returned as a search value.

To use this functionality, add a JS injection into a <values> field in a following format:

JS injection
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 there, follow instructions in the Script Includes article (write a script and invoke it using the ss.importIncludeScript method). The script maximum length is limited up to 255 symbols.

The example of include script in injections is provided below:

Include script in injections
javascript: ss.importIncludeScript('DateTimeScript'); return getWeekStartDate();

Condition Builder is a tool that allows creating conditions to collect fields formed dynamically and setting multiple conditions for specific request, depending on the context.

The Condition Builder helps users to filter lists, create ACL and Business Rules, etc. 

Condition format


The condition consists of three parts:

  • Field
  • Operator
  • Value.

Field is a choice list consisting of table fields. You can choose fields from the related tables using dot-walking.

Operator is a choice list consisting of different set of operators depending on a field type. For example, in the Task table, you cannot apply the greater than operator to the Active field, since it's a Boolean field. But you can use this operator to any field of a number type.

Value is a text field, or text fields set, or a choice list, depending on a chosen field and operator. For example, for the Active field of a Boolean type, the value area will be a choice list with the options displayed: 'false' and 'true'. For the Description field, the value area is an input text field.

Condition Builder Actions


Click on the funnel sign  to call Condition Builder toolbar.

  • AND  – tells the database that search items should contain the condition necessarily. 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. Available on lists only.

  • Save – saves the configured conditions. Before saving, be sure to enter the name for the filter. Available on lists only.
  • Run – runs the configured condition to apply the filter. Available on lists only.
  • Close – hides the condition builder. Available on lists only.
  • Clear All  deletes defined conditions.

Breadcrumb Navigation 


In SimpleOne, Breadcrumb Navigation is an element of the interface that display all applied conditions for filtering. You can see Breadcrumbs above the Condition Builder toolbar, near the funnel sign

You can reset applied conditions by clicking on arrows  to delete unnecessary filters. 

To delete all filters but one you need to click on the filter that you want to keep.

Quick Filtration


Show MatchingFilter 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 MatchingFilter Out, and Group By one more time. All applied conditions you can see in Breadcrumbs Navigation.

It is convenient to use Quick Filtration, if you need to apply one condition without any details. Use Condition Builder toolbar, if you need to apply several conditions with details.

  • Show Matching – displays elements that contain the same parameter. It corresponds with positive and AND operators.
  • Filter Out – eliminates all elements with one certain parameter. It corresponds with negative operators, for example, is notdoes not, etc.
  • Group By – collects all elements with the same parameters. As a result, you will see groups based on the condition and the number of elements in each group. It is the same operator as Group in Condition Builder toolbar. You can navigate to each group to see the records and also Open a group in the list

To process the filtering, please complete the steps below:

  1. Navigate to the list you need. 
  2. Right-click on the value of any field and open the context menu.
  3. Select the necessary action.

 

Condition String


Condition string describes conditions, applied to the table fields, combined with the AND and OR operators. It is generated automatically by the condition builder. It can be seen in the URL in the condition parameter, after filtering the list. Also, it can be created manually in scripts.

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 represented as described below:

a0^a1^a2^...^an,  or a0^ORa1^ORa2^OR…^ORan

Where an – are the same condition strings bracketed.

Special symbols

SymbolDescription
^AND operator.
^OROR operator.
^ORDERBYThe ascending sorting.
^ORDERBYDESCThe descending sorting.
@Values delimiter in the <values> section (see the Node conditions section in this acrticle for more information).

The complex expressions can be built using AND/OR operators; to prevent collisions, elementary expressions inside the complex one are bracketed.

Node conditions


The node conditions can be represented like described below:

<attribute><operator><values>

<attribute> – the table attribute (that is system name of the field). Dot-walking attributes can be used, for example, assigned_user.id.company.name.

<operator> – the operator available to use with the selected <attribute>.

<values> – the set of the values (operands) divided by "@".

JavaScript injections

The <values> field also supports so called JavaScript injections, so you can specify a JavaScript short scenario in case the <values> field is of one of the text input types. This scenario will be interpreted, and its results will be returned as a search value.

To use this functionality, add a JS injection into a <values> field in a following format:

JS injection
javascript: script_text

The field supports commas ',' and line breaks (\n).

You can also use include scripts in this injections. To use an include script there, follow instructions in the Script Includes article (write a script and invoke it using the ss.importIncludeScript method). The script maximum length is limited up to 255 symbols.

The example of include script in injections is provided below:

Include script in injections
javascript: ss.importIncludeScript('DateTimeScript'); return getWeekStartDate();

  • No labels