EQL query syntax

EQL365 is a query language for searching data in BRIX. It lets you find app items by field values, combine multiple conditions, use parameters, and search by dates, users, and related objects.

This article describes the rules for writing EQL queries, available operations and functions, and examples of simple and nested queries.

To learn where you can use EQL queries, see EQL365 search queries and Search in apps.

Choose an EQL construct for your task

What you need to do

Where to find it

Create a simple EQL query

Basic EQL query

Learn how to write strings, numbers, dates, and other values

How to write values in an EQL query

Add fields for entering values to the search form and save the query as a filter

Creating and using EQL query parameters

Compare values, find a match, an empty field, or one of several values

Search operations

Combine multiple conditions or exclude a condition

Logical operators

Specify a date, time, or period relative to the current date

Functions: Datetime(), Time(), RelativeDatetime()

Find records related to the current user

Current user. CurrentUser()

Specify a specific or any item from an arbitrary app

Collection item. Refitem()

Count items or subquery results

Number of items. Count()

Find items in another app based on specified conditions

Selection operators in subqueries

Access properties of a parent or root app

Nested subqueries

Basic EQL query

A minimal EQL query consists of three parts:

[variable_code] operation value

начало примера

Example

[price] > 10000

The query finds items where the field with the code price is greater than 10,000.

конец примера

When writing a query, follow these rules:

  1. To access an app property, specify its code in square brackets: [property_name].
  2. After the property code, specify the search operation: a mathematical symbol or the EQL365 keyword.
  3. Write the value to search for according to the rules for the property type.
  4. To specify or calculate a value, you can use functions, such as Datetime() or CurrentUser().
  5. To enter values after creating the query and reuse them multiple times, create parameters. Parameter fields will automatically appear in the search window.
  6. For searches with multiple conditions, use logical operators. You can use parentheses to specify the order in which the conditions are evaluated.
  7. For complex queries, use subqueries. In them, you can access properties of any app in the system.
  8. Separate all parts of the query with spaces.

When writing a query, you can use autocomplete. To open the list of available properties, functions, and operators, press Ctrl + Space.

начало примера

Examples

  1. [company_name] = 'AutoIndie' or [company_name] like 'Auto' 

Find items in the Companies app, where the Name field exactly matches the value AutoIndie or contains the value Auto.

  1. [__createdAt] >= Datetime(2025, 1) and [__createdAt] < Datetime(2025, 2) and  [price] > 4000

Search for records in the Orders app, where the Creation date field is January 2025, and the value of the Price field is greater than 4,000.

  1. [contract] in (select [__id] from [documents.contracts] where [total] > 10000)

Search for records in the Contractors app, where the Contract field contains an app item with an amount greater than 10,000.

конец примера

How to write values in an EQL query

Values in an EQL query are written differently depending on the property type. For example, text is enclosed in single quotes, while numbers are not. The main rules and examples are provided in the table. Additional explanations for dates, users, and related objects are provided below.

Property type

How to write the value

Example

String

As a string in single quotes

[authors_name] like 'Alex': the Author name field contains the value Alex.

[product] in ('fan', 'fridge'): the Product field contains one of the specified values.

[authors_name] is null: author name is not specified.

Number, Money

As a number without quotes. The decimal part is separated by a period

[size] < 5.5: in the Size field, the value is less than 5.5 meters.

[price] >= 5000: the value of the Cost field is greater than or equal to 5,000.

Yes/no switch

With the true value without quotes

[prepayment] = true: in the Prepayment field, the value is Yes.

[prepayment] <> true: the value Yes is not selected; the field contains No.

[prepayment] is null: the field is empty.

Date/time

As a string in single quotes. Date parts are separated by hyphens. You can use the shortened format and add a time and time zone.

For complex conditions and relative dates, use the functions: Datetime() and Time(), RelativeDatetime().

[close_date] > '2025-01-31-12': search for items with a closing date later than January 31, 2025, 12:00.

[close_date] < '2025-01-31T12:30:00': the closing date is earlier than the specified date, with the time zone ignored.

[close_date] > '2025-01-31T12:30+09:00': the closing date is later than the specified date, with the time zone UTC+09:00.

Category

With the category code in single quotes

[payment] in ('half', 'full'): in the Payment field, one of the specified values is selected.

Phone number

As a string in single quotes

[phone] = '+341234567890'

Email

As a string in single quotes

[email] = 'admin@example.com'

Full name

As a string in single quotes

[contact] like 'Diana': the Contact person field contains the value Diana.

Users

With the user ID in single quotes, without spaces

[responsible] = '95806fe5-f8e8-460c-b2be-ce607068726c'

App

With the item ID in single quotes, without spaces

[app] = '018a1c61-c2b9-7701-86ab-d8b39a143465'

Arbitrary app

As a string in single quotes. The path consists of the workspace code, app code, and, if necessary, the item ID. Path components are separated by colons and written without spaces.

[client] = 'clients:contracts:1415381a-1197-11ee-be56-0242ac120002': a specific app item is specified.

[client] = 'clients:contracts': an arbitrary app item is specified.

Status

With the numeric status ID without quotes

[__status] = 1: the item has the first status in the list.

To specify a specific user in a query, go to Company > Employees, select the user page, and copy the ID from the page URL.

To specify a specific app item, open the required record and copy its ID from the page URL.

To find items with an empty property, use the operations IS NULL or IS EMPTY. The exception is properties of Phone number and Email types.

Creating and using EQL query parameters

In an EQL query, you can create a parameter for a specific property. You can enter different values for it to find matching app items without changing the query itself.

The parameter is displayed on the search form as an additional field where the user specifies the value to search for.

You can save the query as a filter and reuse it. The saved filter appears in the side panel of the advanced search window.

To create a parameter:

  1. In square brackets, specify the code of the app property to search by.
  2. Add the = symbol @ and an arbitrary parameter name Latin characters.
  3. To search for items using multiple parameters, combine conditions with the operators AND or OR. For more information, see the Logical operators.

eql-syntax-01

When working with a query that contains parameters, the user can:

  • Enter values in the fields that appear and run the search.
  • Save the query as a filter. The Save button at the bottom of the window is active if no parameter values have been entered.

начало примера

Example

[__createdBy] = @User AND [budget] = @Amount

The query contains two parameters for finding deals by author and amount. The search form will display the User and Amount fields.

конец примера

Search operations

A search operation specifies a condition for comparing a property with a specified value, another property, or the result of a function. EQL365 uses mathematical symbols and keywords.

Symbol-based operations

In all such operations, specify the property code on the left and the value, another property, or function on the right.

Equals =

Checks for an exact match.

начало примера

Examples

  1. [client] = 'Starr'

Find a customer with the specified name.

  1. [payment] = [budget]

Find items where the values of the Payment and Budget fields match.

  1. [responsible] = CurrentUser()

Find items where the current user is specified as the responsible person.

конец примера

The = operation cannot be used with properties with the Multiple values subtype. Use IN instead.

Using = with properties of the Date/time type is not recommended because the query checks for an exact value match.

Not equal <>

Excludes an exact match.

начало примера

Examples

  1. [product] <> 'Appliances'

Find orders where the Product field is not set to Appliances.

  1. [payment] <> [budget]

Find orders where the values of the Payment and Budget fields do not match.

  1. [responsible] <> CurrentUser()

Find items where the current user is not specified as the responsible person.

конец примера

Greater than >

Checks that the property value is greater than the specified value.

начало примера

Examples

  1. [price] > 10000
  2. [payment] > [budget]
  3. [shipping_date] > Datetime(2025, 1, 31, 12)

конец примера

Greater than or equal to >=

Checks that the property value is greater than or equal to the comparison value.

начало примера

Examples

  1. [price] >= 10000
  2. [payment] >= [budget]
  3. [shipping_date] >= Datetime('Today')

конец примера

Less than <

Checks that the property value is less than the comparison value.

начало примера

Examples

  1. [price] < 10000
  2. [payment] < [budget]
  3. [shipping_date] < Datetime('Today')

конец примера

Less than or equal to <=

Checks that the property value is less than or equal to the comparison value.

начало примера

Examples

  1. [price] <= 10000
  2. [payment] <= [budget]
  3. [shipping_date] <= Datetime('Today')

конец примера

Keyword-based operations

Partial string match. LIKE

The LIKE operation is used to search for a partial text match without regard to case. It finds strings containing the specified value anywhere in the string.

начало примера

Example

[responsible] like 'Alex'

The query finds items where the Responsible field contains the specified value.

конец примера

Exact string match and pattern search. LIKEF

The LIKEF operation is used to search for an exact text match. Special characters can also be used to specify where the search value should appear in the string and narrow the search results.

The LIKEF operation can be used with properties of the following types:

When writing a query, use the following symbols:

  • _ indicates any single character. It can be placed before or after the search value.
  • %  indicates that any number of characters can appear before or after the search value.

The _ and % symbols can be combined and used multiple times in a query to build complex patterns.

If the search value contains the control character _ or % escape it with a backslash \.

начало примера

Examples

  1. [client] likef 'Mike'

The query searches for records where the Client field contains the exact value Mike. For example, Mike Larson, Mike Cohen, and so on.

  1. [string] likef '_010203'

The query searches for strings that begin with any single character followed by the value 010203.

  1. [phone] likef '0912%'

The query finds records where the phone number starts with 0912 and may be followed by any number of characters.

  1. [order_name] likef 'Products%10_2024'

The query finds orders whose name starts with the value Products then contains any number of characters and ends with the value 10, one arbitrary character and the value 2024.

  1. [email] likef '_peters\%@example%'

The query finds email addresses that start with any single character, contain the value peters%@example, and end with any domain. The character %, which is part of the search value, is escaped with a backslash \.

конец примера

Field is empty. IS NULL and IS EMPTY

These operations are used to find items where the field has no value. The case of the operation keyword is ignored.

начало примера

Example

  1. [budget] is null
  2. [budget] is empty

Equivalent queries for finding orders where the budget is not specified.

конец примера

Value belongs to a set. IN

The IN operation checks whether the property contains one of the specified values. Case is ignored when comparing values.

List the values to search for in parentheses, separated by commas, with or without spaces. You can use a subquery instead of a list of values.

If the condition uses the CurrentUser()function, you can place it and the property code on either side of the IN.

начало примера

Examples

  1. [order_number] in (6,7,8,9)

Find all orders whose numbers contain the listed numbers.

  1. [client] in ('Lisa', 'Lina', 'Lee')

Find all customers with the listed names.

  1. [__createdBy] in CurrentUser() or CurrentUser() in [__createdBy]

Equivalent queries for finding all items created by the current system user.

  1. Example with a subquery.

[orders] in (
  select [__id]
  from [documents.contracts]
  where [total] > 10000
)

Find all orders whose contracts have a value greater than 10,000 in the Total field.
For more information about creating such expressions, see Subqueries.

конец примера

Logical operators

Logical operators let you check multiple conditions in a single query.

All conditions. AND

The AND operator combines multiple conditions. The search results include items that meet all conditions.

начало примера

Examples

  1. [prepayment] = 1000 and [budget] > 3000

Find orders where the prepayment is 1,000 and the budget is greater than 3,000.

  1. [__createdAt] >= Datetime(2025, 1) and [__createdAt] < Datetime(2025, 3)

Find items created in January and February 2025.

конец примера

At least one condition. OR

The OR operator combines multiple conditions. The search results include items that meet at least one of them.

начало примера

Examples

  1. [order_number] in (6,7) or [client] is null

Find orders with order number 6 or 7 or the Client field is empty.

  1. Example with a subquery and a selection operator FROM_SELECT_WHERE.

[client] like 'Alex'
 or [orders] in (
 from [documents.contracts]
 select [__id]
 where [total] > 10000
)

Find orders where the customer name contains the value Alex or the amount of the related contract exceeds 10,000.

конец примера

Condition must not be met. NOT

The NOT operator applies to a single condition. The search results include items for which the condition is not met.

начало примера

Examples

  1. not [payment] is null

Find accounts where the Payment value is empty.

  1. not [client_name] in ('Kollen', 'Markovic')

Find orders where the customer name does not match any of the specified values.

конец примера

Order of condition evaluation

If a query uses multiple logical operations, you can use parentheses to specify which condition should be evaluated first. Parentheses determine the order in which conditions are evaluated in a complex expression.

начало примера

Examples

  1. not ([client_name] like 'Lisa' or [client_name] like 'Elena')

Find orders where the customer name contains neither the value Lisa nor the value Elena.

  1. (not [client_name] = 'Lisa') and [client_name] like 'Li'

Find orders where the customer name is not equal to Lisa but contains the value Li.

конец примера

Functions

Functions let you specify or calculate a value used in an EQL query condition.

Date. Datetime()

The Datetime() function sets a date and, if necessary, a time. Parameters are specified in parentheses, separated by commas, in the following order:

  1. year
  2. month
  3. day
  4. hour
  5. minute
  6. second
  7. time zone

Only the year is required. You can omit the other parameters or skip to the next one. If the time is not specified, the values 0 are used for the hours, minutes, and seconds.

Instead of a specific date, you can pass the following to the function:

  • Today: the current date
  • Now: the current time

Important: using the Datetime(2025, 1, 31, 12) function to specify a date is equivalent to the string notation '2025-01-31-12'. For simple fixed dates, you can use either method.

начало примера

Examples

  1. [__createdAt] > Datetime(2024)

Find items with a creation date later than 2024.

  1. [__createdAt] > Datetime(2025, 1, 31)

Find items with a creation date later than January 31, 2025.

  1. [finish_date] > Datetime(2025, 2, '+09:00')

Find orders whose assembly was completed after February 2025, taking the specified time zone into account.

  1. [__createdAt] < Datetime('Now')

Find items with a creation date earlier than the current time.

  1. [closing_date] > Datetime('Today')

Find deals with a closing date later than the current date.

  1. [close_date] > Datetime(2025, 1, 31, 12)

Find items where the value of the Closing date field is later than January 31, 2025, 12:00.

конец примера

Time. Time()

The Time() function sets a time. In parentheses, specify the hour, minute, and second, separated by commas. Only the hour is required.

начало примера

Examples

  1. [closing_time] < Time(17)

Find deals closed before 17:00.

  1. [closing_time] > Time(12, 30, 00)

Find deals closed after 12:30.

конец примера

Period relative to the current date. RelativeDatetime()

The RelativeDatetime() sets a time period relative to the current date, taking the time zone configured in the system into account. The function can be used in conditions with the = and IN operators.

Function syntax:

RelativeDatetime('start', 'end')

The function always has two parameters:

  • start. Start of the period.
  • end. End of the period.

Parameters are enclosed in single quotes and separated by commas. Each parameter uses an alphanumeric expression or a combination of such expressions.

The numeric part specifies the direction and number of periods:

  • Negative value is a past period.
  • Positive value is a future period.
  • 0 is the current period; the + sign before zero is not required.

Letter designations for time interval units

Parameters are calculated sequentially. The calculation is based on calendar periods rather than a fixed number of time units.

For example, if the current date is December 11, 2025, the value -1m represents the previous calendar month, not the previous 30 days. The period starts on November 1, 2025.

How the start of the period is calculated

The parameter start specifies the start of the period. The calculated value is included in the search results.

Examples:

  • 0h.: from the start of the current hour.
  • +1m.: from the start of the next month.
  • -1w+1d.: one day is added to the start of the previous calendar week. For example, if today is Monday, the search starts on Tuesday of the previous week.

How the end of the period is calculated

The parameter end specifies the end of the period. When calculating it, one unit is added to the smallest specified time unit. The resulting value is not included in the results: values less than it are included.

Examples:

  • 0h.: through the end of the current hour.
  • 0d.: through the end of the current day.
  • +1m.: through the end of the next month.
  • -1w+1d: the calculation starts from Monday of last calendar week. Then one day is added from the parameter, plus one more day to determine the upper bound. This results in Wednesday of last week, which is not included in the period. So the search runs through the end of Tuesday of last week.

The start of the period must be earlier than its end. If the start is later than or equal to the end, the user sees an error indicating an invalid relative date format.

начало примера

Examples

  1. [date] IN RelativeDatetime('0d', '0d')

Search for the current date.

  1. [date] IN RelativeDatetime('-1d', '-1d')

Search for the previous day.

  1. [date] IN RelativeDatetime('0w', '0w')

Search for the current week.

  1. [date] IN RelativeDatetime('-1w', '-1w')

Search for the previous week.

  1. [date] IN RelativeDatetime('-7d', '-1d')

Search for the previous seven days.

  1. [date] IN RelativeDatetime('+1w', '+1w')

Search for the next week.

  1. [date] IN RelativeDatetime('-1w+2d', '-1w+3d')

Search from last Wednesday through the end of last Thursday.

  1. [date] IN RelativeDatetime('-1m', '+1m')

Search from the start of last month through the end of next month.

  1. [__createdAt] IN RelativeDatetime('-1m','0d')

Search for all items created from the start of last month through the current date.

  1. [date] IN RelativeDatetime('0y+3q','0y')

Search for items from the third quarter of the current year through the end of the year.

  1. [date] IN RelativeDatetime('0y-2m', '0y-1m')

Search for the last and second-to-last months of the previous year.

  1. [date] IN RelativeDatetime('+1y', '+1y0m')

Search for the first month of the next year.

конец примера

Number of items. Count()

The Count() function counts the number of items:

  • In a multi-value property.
  • In subquery results.

In a comparison condition, specify the function before the property or subquery without a space.

начало примера

Examples

  1. Count([orders]) > 3

Find companies for which more than three orders have been created.

  1. Examples with a subquery.

Count(
 from [documents.contracts]
 where parent.[__id] in [client]
 and [total] > 10000
) > 2

Find companies for which more than two contracts have been created, with each contract totaling more than 10,000.

Count(
 from [_clients._contracts]
 where parent.[_email] = [_email]
 and parent.[_phone] = [_phone]
) > 1

Find items in the app Contacts, where the email addresses and phone numbers are the same.

The second and third examples use a nested subquery with the operator PARENT.

конец примера

Current user. CurrentUser()

The CurrentUser() function returns the ID of the user running the query. You can use the resulting value in a condition for searching by an app property.

начало примера

Example

[responsible] = CurrentUser()

Find orders for which the current user is responsible.

конец примера

Collection item. Refitem()

The Refitem() function is used to retrieve a specific or any item from a field of the Arbitrary app type.

The function syntax depends on the task.

To find records where the field contains a link to a specific app item, specify:

  • Workspace code
  • App code
  • Item ID

To find records where the field contains any value from a specified app, use one of the following methods:

  • Specify only the workspace code and app code.
  • Specify the workspace code, app code, and an undefined item ID.

Parameters are enclosed in single quotes and separated by commas.

начало примера

Examples

  1. Find a record related to a specific app item.

[bill] = Refitem(
    'documents',
    'invoice',
    '018a8dbb-04cd-7798-a363-aae245148b10'
)

Find contracts where the Invoice field contains an item with the specified ID from the Invoices app.

  1. To find records where the field contains any item from a specified app, specify only the workspace code and app code.

[contract] = Refitem('cleints', 'contracts')

Or additionally specify an undefined ID:

[contract] = Refitem(
    'clients',
    'contracts',
    '00000000-0000-0000-0000-000000000000'
)

Both queries are used to find items where the Contract field contains any record from the Contracts app in the Clients workspace.

  1. Search for an empty field.

To find items where a field of the Arbitrary app is not filled in, use the IS NULL operation:

[invoice] is null

Find contracts where the Invoice field is empty.

конец примера

Subqueries

A subquery is an EQL query nested within another query. It is enclosed in parentheses within the main query.

Selection operators in subqueries

Subqueries let you find app items by specified values. For example, you can use a subquery to find records for companies for which a contract was issued no later than a specified date.

Use the following operators to specify search parameters in a subquery:

  • SELECT_FROM_WHERE or FROM_SELECT_WHERE. They are used to access items from other workspaces and properties of the Arbitrary app type.
  • FROM_WHERE. Used to select items by properties of the current app or another app. Used together with:
    • PARENT or ROOT operators, which let you establish a link between apps and find items by the specified property.
    • Count()function, which determines the number of items that match the search conditions.

Selection operator syntax

Each subquery specifies:

  1. Data source. The app code from which the data is selected.
  2. Search property. The property of the data source used for the search.
  3. Search condition. The criterion used to filter the data.

начало примера

Examples

  1. [clients] in (select [__id] from [clients.orders] where [total] > 1000)

Select items from the Clients app that have associated orders with an amount greater than 1,000 have been created.

  1. [contracts] in (select [__id] from [clients.leads] where [__name] = 'ООО Пристань')

Find contracts from a field of the Arbitraty app type, where the company name matches the one specified in the query.

  1. Examples with a nested subquery with the operator PARENT.

count(
 from [orders.products]
 where parent.[product_sku] = [product_sku]
) > 1 

Select items from the Products app with the same SKU value.

count(
 from [bookstore.book] 
 where parent.[__id] in [authors]
) > 0 

Find authors whose record contains at least one book.

конец примера

Nested subqueries

Subqueries can include other subqueries. To access app properties based on the nesting level, use the following operators:

  • PARENT accesses properties of the parent app, which is one level above in the query.
  • ROOT accesses properties of the root app specified at the beginning of the query. For example, this can be the app from whose page the EQL search is performed.

Examples of nested queries