---
title: Operators
description: Operators in the PingOne Expression Language are used to manipulate individual data items and data sets.
component: pingone
page_id: pingone:pingone_expression_language:p1_expressionlang_operators
canonical_url: https://docs.pingidentity.com/pingone/pingone_expression_language/p1_expressionlang_operators.html
revdate: April 25, 2025
page_aliases: ["p1_expressionlang_relational_operators.adoc", "p1_expressionlang_logical_operators.adoc", "p1_expressionlang_mathematical_operators.adoc", "p1_expressionlang_ternary_operator.adoc", "p1_expressionlang_elvis_operator.adoc"]
section_ids:
  p1-exp-lang-rel-operators: Relational operators
  p1-exp-lang-logic-operators: Logical operators
  p1-exp-lang-math-operators: Mathematical operators
  p1-exp-lang-ternary-operators: Ternary operator
  p1-exp-lang-elvis-operators: Elvis operator
---

# Operators

Operators are constructs used to manipulate individual data items and data sets. These include arithmetic, comparison, and logical operations.

## Relational operators

The following relational operators are supported by using standard operator notation:

* Equal

* Not equal

* Less than

* Less than or equal to

* Greater than

* Greater than or equal to

Each symbolic operator can also be specified as a purely alphabetic equivalent that is case insensitive.

|   |                                                                             |
| - | --------------------------------------------------------------------------- |
|   | All operator notations except for `!` require a leading and trailing space. |

| Alphabetic relational operator | Examples                                                                                                                                        |
| ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| * `lt`

* `<`                  | `5 lt 12``5 < 12``user.activeDays < 30`&#xA;&#xA;Because the operator is missing a leading and trailing space, user.activeDays<30 is incorrect. |
| - `le`

- `⇐`                  | `6 le 6``6 ⇐ 6``user.activeDays ⇐ 30`                                                                                                           |
| * `gt`

* `>`                  | `12 gt 5``12 > 5``user.activeDays > 30`                                                                                                         |
| - `ge`

- `>=`                 | `12 ge 5``12 >= 5``user.activeDays >= 30`                                                                                                       |
| * `eq`

* `==`                 | `5 eq 5``5 == 5``user.activeDays == 30`                                                                                                         |
| - `ne`

- `!=`                 | `6 ne 5``6 != 5``user.activeDays != 30`                                                                                                         |
| * `not`

* `!`                 | `not (4 > 3)``!(user.activeDays < 30)`                                                                                                          |
| `matches`                      | Checks if a value matches the regular expression pattern.`'name' matches '[a-z]+'`                                                              |

## Logical operators

|   |                                                                                     |
| - | ----------------------------------------------------------------------------------- |
|   | All logical operator notations except for `!` require a leading and trailing space. |

| Logical operator | Example                                      |
| ---------------- | -------------------------------------------- |
| `and`            | `5 > 3 and 4 ⇐ 4`                            |
| `or`             | `5 > 3 or 4 < 3`                             |
| * `not`

* `!`   | `5 < 13 and not (4 < 3)``5 > 6 and ! 4 < 14` |

## Mathematical operators

All the following operators used for binary operation require a leading and trailing space.

| Mathematical operator | Description                                                                                                                                                                                                                                                                                                   |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `+`                   | Add numbers or concatenate if one of the operands is a string.`5 + 6``'Test' + 3`&#xA;&#xA;Because one of the operands is a string, it will return a string concatenation.`user.loginAttempts + user.logoutAttempts`&#xA;&#xA;Because the operator is missing a leading and trailing space, 5+6 is incorrect. |
| `-`                   | Subtraction`7 - 5``user.totalLicenses - user.activeLicenses`&#xA;&#xA;Because the operator is missing a leading and trailing space, 7-5 is incorrect.                                                                                                                                                         |
| `*`                   | Multiplication`3 * 5``user.avgLoginsPerMonth * 12`                                                                                                                                                                                                                                                            |
| `/`                   | Division`12 / 3``user.totalLogins / 12`                                                                                                                                                                                                                                                                       |
| `%`                   | Modulus: Get remainder after division`7 % 4`                                                                                                                                                                                                                                                                  |
| `^`                   | Exponential Power`2 ^ 3`, which is equivalent to `(2 * 2 * 2)`                                                                                                                                                                                                                                                |

## Ternary operator

You can use the ternary operator to perform single line if-then-else logic expressions.

```
user.enabled ? 'Active' : 'Inactive'
```

## Elvis operator

The Elvis operator is a short form for the [Operators](p1_expressionlang_operators.html) for null checks. This operator requires a leading and trailing space.

You can rewrite `user.id != null ? user.id : 'N/A'` as `user.id ?: 'N/A'`.
