Important

You are browsing the documentation for version 1.6 of OroCommerce, OroCRM and OroPlatform, which is no longer maintained. Read version 5.1 (the latest LTS version) of the Oro documentation to get up-to-date information.

See our Release Process documentation for more information on the currently supported and upcoming releases.

Available in OroCRM Available in OroCommerce

Filters

Filters are used to define a set of records to be displayed. Its configuration enables users to automatically select only the records that meet the filter requirements. Filters are always created for the records of a specific type (entity) specified in the general details of the relevant field.

This section will help you learn the basics of filtering expressions and their elements.

Filters Options

To define filter, use any of the following filter options or combine them:

  • Field Condition: select only the records with specific values of the selected fields.
  • Activity: select only the records to which a specific kind of activity has been/has not been assigned.
  • Data Audit: select only the records that have been modified in a specific way (available only when the corresponding functionality is enabled for an entity).
  • Conditions Groups: sets of field conditions that combine requirements of several other filters in one group.
  • Segments: sets of records dynamically or manually updated in compliance with predefined filters. More details are described in the Segments guide.

Sample filter that finds all the records with any related activity logged:

../../../../_images/filters_1.1.png

AND/OR Operators

To combine the conditions of two or more filters, you can use the operators AND and OR:

  • If AND is used, only the records that meet conditions of all the connected filters will be selected.
  • If OR is used, all the records that meet conditions of any of the connected filters will be selected.

The following sections provide a detailed explanation of the filters with examples for different operators.

../../../../_images/filters_1.png

Field Conditions

Field Condition filters specify a rule for values of the record attributes. Only the records that meet the condition will be selected.

To define a field condition:

  1. Drag Field condition to the box on the right.
../../../../_images/filters_2.png
  1. Click Choose a field.
../../../../_images/filters_3.png
  1. A list of fields appears. At the top of the list, you can see the name of the field, for which the records are filtered. (In the example below it is a Contact). Below the Contact name, there is a list of all available fields related to it.
../../../../_images/filters_4.png
  1. Select a field that you want to apply for the rule:
  • This can be a field of the entity selected in the General section. For example, we can filter Contact records by gender.
../../../../_images/filters_5.png
  • You can also select a field of another entity, related to it. For example, if you want the list to contain only Contacts with addresses in California.

    To do so, scroll down the list and select this field under the Related Entities header.

    ../../../../_images/filters_6.png

    The name of the selected field (in our example, it is Addresses) will appear at the top of the list.

    ../../../../_images/filters_7.png
  • You can also add another field related to Addresses under the Related entities section. For example, you can select only the contacts whose Address Owner has a specific Email.

    ../../../../_images/filters_8.png

Hint

Once you have specified all the required conditions, another default field condition appears. Some components of this field contain links with a list of possible values suitable for the specified field.

../../../../_images/filters_9.png

Activities

The Activity filter specifies a rule for activities assigned to the record. Only the records that meet the condition will be selected.

To define the activity settings:

  1. Drag Activity to the box on the right.
  2. There are three selector links:
  • Has activity /has not activity - only the records to which the defined activity has/has not been assigned will be selected.

    ../../../../_images/filters_10.png
  • The List of available activities to filter by.

    ../../../../_images/filters_11.png
  • Choose a field: select the field to filter by. For example, we will select only the records, for which a call was logged after July 1, 2015.

../../../../_images/filters_12.png

Data Audit

The Data audit filter specifies a rule for the record changes recorded in the system. Only the records that meet the condition will be selected.

To define the data audit settings:

  1. Select a field for which a condition is defined in the same way as described above in Field Conditions.

  2. Determine if the condition should be valid for the records where the field has or has not been changed.

    ../../../../_images/filters_13.png
  3. Select the date when the changes have/have not been applied.

For example, we will select only the records, for which Job Title value has been changed since July 1, 2015.

../../../../_images/filters_14.png

Note

You can combine any number of Activity, Data audit, and Field Condition filters, joining them with the AND and OR operators.

Conditions Groups

A conditions group is a set of activity and/or data audit, and/or field condition filters already joined with the AND and OR operators. A field condition works as the brackets in mathematics, so all the filters added to a condition group are applied first.

To define the Condition Group filter:

  1. Drag Conditions Group to the box on the right.
  2. Add the Activity, Data audit, and Field Condition filters to the section that appears.
  3. Define the conditions and conjunctions between them.

Important

Keep in mind that if a user generates a report with several conditions (for example, A and B) in one conditions group, they receive the report that includes the values that satisfy the A condition, the B condition, and both. In case you want to get the report only with both conditions applied, enable the Group Same-Entity Conditions Within Condition Groups option in the system configuration. This way, the report will contain only the values that match all the defined conditions.

For complex conditions, it is a good idea to draw an outline of the conditions first.

A condition group may also be included into another condition group as a separate filter.

Segments

A segment is a set of the Activity, Data audit, Field Condition, and Condition Group filters created separately for the records of a specific field. It can be updated dynamically or upon a user’s request.

In other words, if you often need to use a specific set of conditions to filter the entity records, you can create a segment and use it instead of redefining the same conditions again.

The ways to create and manage segments are described more detailed in the Segments guide.

To add a segment to the filters:

  1. Drag Apply segment to the box on the right.

    ../../../../_images/filters_15.png
  2. Click Choose segment and select one of the Segment predefined in the system.

    ../../../../_images/filters_16.png

Subject to the conjunction with the rest of conditions, the list will now include:

  • Only the records from the segment that correspond to the rest of conditions (AND is used).
  • The records that correspond to the rest of conditions and the segment (OR is used).