IQL (Iru Query Language) is Iru’s expression language for mapping, used in several places:
- The attributes and claims an application receives at sign-on.
- The fields a connected source maps into your directory (see Attribute mapping).
- Auto Group rules and list filters.
Referencing your data
What you reference depends on where the expression runs:-
Application mapping starts from the
userobject, whose fields are your directory’s profile attributes:The defaults reflect this: an OIDC app’s subject defaults touser.id, and a SAML app’s Subject defaults touser.username. -
Directory Sync mapping references the source’s field names directly, as
they come from the connected system:
user.profile.team), and into a list or map with [...] (covered below).
Building blocks
| Form | Example | What it is |
|---|---|---|
| Field / variable | first_name, user.email | A value by name, or a field on a value. |
| Method call | user.email.upperAscii() | A function called on a value. |
| Indexing | parts[0] | An element of a list by zero-based position. |
| Map key | entry["label"] | The value stored under a string key. |
| Grouping | (a + b) * c | Parentheses to control evaluation order. |
Literals
\n, \t, \\, \", and \uXXXX.
Operators
- Arithmetic
- Comparison
- Logical
- Membership & choice
| Operator | Example | What it does |
|---|---|---|
+ | first_name + " " + last_name | Adds numbers, or joins strings. |
- * / | a * b | Subtract, multiply, divide. |
% | a % b | Remainder (modulo). |
Precedence
From tightest-binding to loosest. When in doubt, add parentheses.String functions
String operations are written as methods on a value, in the formvalue.method(...):
| Method | Example | What it does |
|---|---|---|
upperAscii / lowerAscii | user.email.lowerAscii() | Upper- or lower-case the value. |
trim | first_name.trim() | Remove surrounding whitespace. |
split | user.email.split("@") | Split into a list by a separator; index it with [n]. |
replace | phone.replace("-", "") | Replace every occurrence of one substring with another. |
contains | user.email.contains("+") | True if the value contains a substring. |
startsWith / endsWith | user.email.endsWith("@acme.com") | Test how the value begins or ends. |
indexOf | username.indexOf(".") | Position of a substring, or -1 if absent. |
matches | user.email.matches("^[a-z]+@acme\\.com$") | True if the value matches a regular expression. |
size | user.email.split("@").size() | Length of a string or list. Also available as size(value). |
Conditionals and defaults
The conditional operator is the simplest way to supply a fallback when a value might be blank:Optional values
Optional helpers let you work with values that might be missing without causing an error. An optional either holds a value or is empty.- Create
- Access safely
- Unwrap
- Transform
ofNonZeroValue treats these as empty: an empty string "", 0, false,
an empty list [], an empty map {}, and null.Comments and whitespace
Whitespace is not significant, and// starts a comment that runs to the end of
the line:
Examples
Where to go next
Application mapping
Map IQL values into the assertion or token an application receives.
Attribute mapping
Use the same IQL to map a connected source into your directory.
Auto Groups
Drive group membership from IQL rules over profile attributes.
Profile attributes
The
user fields your expressions draw from.