Overview
The rule expression engine evaluates bracket functions and field placeholders in eADM. Expressions appear in:
|
Consumer |
Typical use |
|---|---|
|
Rulesets (Regelsett) |
Filter users, departments, groups; gate message flows, sync steps, permissions |
|
Message templates |
Dynamic recipient, subject, body (HTML) |
|
Export templates / sync template flow lines |
Target attribute mapping |
|
Customer setup |
Username expression, auto-group naming, position filter |
|
Form templates |
Form field bindings |
|
Expression builder |
Preview against a test user, department, or group |
How evaluation works
-
The engine scans the expression for
[...]tokens. -
[ARRAYFOREACH...]runs first — before the innermost-first pass — so template placeholders???and???ibind per pipe-separated element. -
Otherwise it resolves the innermost bracket pair first.
-
Each function returns a plain text result that replaces the bracket.
-
When no functions remain, remaining
[FieldName]tokens are replaced from the current object (and optional history row in message flows). -
Unrecognised field names stay as literal
[FieldName]in the output.
Pipe-separated lists (|) are used for multi-value data — especially HR positions on a user.
Dummy data used in examples below
Unless stated otherwise, examples assume customer Eksempel kommune with:
|
Object |
Key values |
|---|---|
|
User Kari Nordmann |
GivenName= |
|
User positions (pipe-aligned) |
|
|
Department IT (type 2) |
Id= |
|
Department HR (child of IT) |
Id= |
|
System role (permission) |
Id= |
|
Permission on Kari |
SystemRoleId= |
Object type ids (for lookups): User=1, Department=2, Group=3, API user=14.
Syntax conventions
-
Functions:
[NAME;arg1;arg2;...]— arguments separated by semicolon (;). -
Fields:
[FieldName]— value from current object (case-insensitive). -
Nested expressions: inner brackets resolved before outer.
-
List separator: pipe character
|(vertical bar) between values — e.g.POS-01|POS-02. Never type a backslash;|appears only as markdown escaping in source files, not in expressions. -
Dates in fields are often stored as
dd.MM.yyyy HH:mm:ss; imports may useyyyy-MM-ddand other common formats.
Query mini-language
Used inside [FOREACH], [IFTHENELSE], and advanced [OBJECT...] filters.
|
Token |
Meaning |
|---|---|
|
|
Equal |
|
|
Greater / less than |
|
|
Not equal |
|
|
Pattern match (like) |
|
|
Value in list |
|
|
AND next condition |
|
|
OR next condition |
Prefix related data with object., system., systemrole., objectpermission., etc.
Nesting
Inner field first, then outer function
|
Step |
Expression fragment |
Resolves to |
|---|---|---|
|
1 |
|
|
|
2 |
|
|
Blocked if inner field missing: [SUBSTRING;0;10;[UnknownField]] stays unchanged when UnknownField is not on the object.
Typical permission chain (read inside-out):
[REFERENCE;DisplayName;UserId;1;[REFERENCE;Manager;Id;2;[OBJECTPERMISSION;ManagerOf;SystemRoleId;501]]]
-
Permission → department id
2100 -
Department → manager user id
-
User → manager display name
[ARRAYFOREACH...] is different: it expands a pipe-separated list before inner functions in the template run. Use ??? for the current element and ???i for its 0-based index. Nesting [ARRAYFOREACH...] inside another [ARRAYFOREACH...] is not supported — use [ARRAYJOIN] / [ARRAYPREFIX] or sibling calls instead.
Access levels
|
Role |
What it affects |
|---|---|
|
Super manager |
Expression builder preview |
|
Company administrator |
Full function list in builder; |
|
Organization administrator |
Expressions touching protected fields in preview |
|
Super administrator |
|
Automation (sync, messages, exports) evaluates expressions with server privileges. A function that works in production may still be blocked in the expression builder for your role.
Field placeholders
Not functions — replaced from the current object (or history row in event-driven message flows).
Example: Template Hello [GivenName] [Surname] on Kari Nordmann → Hello Kari Nordmann
|
Placeholder |
Typical source |
|---|---|
|
|
Person name |
|
|
Account / mail |
|
|
Primary department |
|
|
Employment start datetime |
|
|
Manager reference from HR |
|
|
Multi-position (pipe-separated) |
History-only (message flows after sync): [OldValue], [NewValue], [EntryType], [AttributeName], [Comment].
Function reference with examples
Each entry lists parameters, a worked example with dummy data, and expected output.
Date and time
[NÅ] / [NOW]
Returns server date and time.
|
Parameter |
Purpose |
|---|---|
|
(none) |
Current moment |
|
|
Add or subtract N days |
|
Expression |
Assumed server date |
Output |
|---|---|---|
|
|
17.06.2026 14:30:00 |
|
|
|
17.06.2026 |
|
Use: Permission start display, relative deadlines in templates.
[DATEFORMAT;date;format]
Reformats a date string.
|
Parameter |
Purpose |
|---|---|
|
|
Input date, or pipe-separated dates |
|
|
Output pattern (e.g. |
|
Expression |
Input (after field resolve) |
Output |
|---|---|---|
|
|
— |
|
|
|
two dates |
|
Use: Export formats, ISO dates in API payloads.
[DATEDIFF;date1;date2;unit]
Numeric difference between two dates.
|
Parameter |
Purpose |
|---|---|
|
|
Later or primary date |
|
|
Earlier or reference date |
|
|
|
|
Expression |
Output |
Meaning |
|---|---|---|
|
|
|
77 days between start and today |
|
|
|
Same calendar year in this example |
Use: Tenure checks in rulesets, "days until start" in messages.
[DAYOFYEAR;date]
|
Parameter |
Purpose |
|---|---|
|
|
Date to evaluate |
|
Expression |
Output |
|---|---|
|
|
|
Use: Seasonal rules, fiscal period tricks.
String manipulation
[SUBSTRING;start;length;text]
|
Parameter |
Purpose |
|---|---|
|
|
0-based start index |
|
|
Number of characters to take |
|
|
Source string (often a nested field) |
|
Expression |
Resolved |
Output |
|---|---|---|
|
|
— |
|
|
|
— |
|
Use: Date-only from datetime in welcome mails: [SUBSTRING;0;10;[Start]] → 01.04.2026.
[SPLIT;text;delimiter;index]
|
Parameter |
Purpose |
|---|---|
|
|
String to split |
|
|
Separator (e.g. |
|
|
0-based piece index, or |
|
Expression |
Output |
|---|---|
|
|
|
|
|
|
Use: Salutation from combined name field; pick last position code.
[REPLACE;text;find;replace]
|
Parameter |
Purpose |
|---|---|
|
|
Original string |
|
|
Substring(s) to replace; pipe = multiple; |
|
|
Replacement text |
|
Expression |
Output |
|---|---|
|
|
|
|
|
|
Use: Normalise phone numbers, swap separators in usernames.
[REPLACELIST;text;fromChars;toChars]
Character-by-character map (both char lists must be same length).
|
Parameter |
Purpose |
|---|---|
|
|
Input |
|
|
Characters to map from |
|
|
Characters to map to |
|
Expression |
Output |
|---|---|
|
|
|
Use: Legacy character set fixes in imports.
[RTRIM;text;chars] / [LTRIM;text;chars]
|
Parameter |
Purpose |
|---|---|
|
|
Input; if it contains |
|
|
Character(s) to strip from end (RTRIM) or start (LTRIM) |
|
Expression |
Output |
|---|---|
|
|
|
|
|
|
Use: Clean pipe lists after [ARRAYDIFF].
[RPAD;text;padChar;totalLength] / [LPAD;text;padChar;totalLength]
|
Parameter |
Purpose |
|---|---|
|
|
Value to pad |
|
|
Fill character |
|
|
Target width |
|
Expression |
Output |
|---|---|
|
|
|
|
|
|
Use: Fixed-width employee numbers in file exports.
[RIGHT;length;text]
|
Parameter |
Purpose |
|---|---|
|
|
How many characters from the right |
|
|
Source |
|
Expression |
Output |
|---|---|
|
|
|
Use: Last digits of national id in test environments.
[INITIALS;text;startWord;endWord]
|
Parameter |
Purpose |
|---|---|
|
|
Full name or phrase |
|
|
Word index to start (0-based) |
|
|
Word index to end, or |
|
Expression |
Output |
|---|---|
|
|
|
|
|
|
Use: Short codes in group names or mail aliases.
[PRETTIFY;text]
Title-cases after space or hyphen.
|
Expression |
Output |
|---|---|
|
|
|
|
|
|
Use: Display names in messages when HR sends uppercase.
[LOWER;text] / [UPPER;text]
|
Expression |
Output |
|---|---|
|
|
|
|
|
|
Use: Normalise before [CLEAN] in username rules.
[CLEAN;text] / [STRICTCLEAN;text] / [CNCLEAN;text]
Strip or replace characters unsafe for usernames, strict ids, or AD common names (CN).
|
Expression |
Typical output |
Use |
|---|---|---|
|
|
|
Username / uid |
|
|
CN-safe form for AD |
Group or user CN |
Exact output depends on customer character rules; test in expression builder.
[GETKEYVALUE;key;delimiter;metadata]
Reads key<delimiter>value pairs inside a pipe-separated metadata string.
|
Parameter |
Purpose |
|---|---|
|
|
Key to find |
|
|
Separator between key and value (often |
|
|
Pipe-separated list of key-value tokens |
|
Expression |
|
Output |
|---|---|---|
|
|
— |
|
Use: Custom import metadata on extension attributes.
Logic and control flow
[IFTHENELSE;query;thenValue;elseValue]
|
Parameter |
Purpose |
|---|---|
|
|
Condition on current object (e.g. |
|
|
Returned if query matches |
|
|
Returned if not |
|
Context |
Expression |
Output |
|---|---|---|
|
User Kari (type 1) |
|
|
|
Department IT (type 2) |
same |
|
Use: Single template for mixed object types.
[IFEMPTYUSE;primary;fallback;reversed]
|
Parameter |
Purpose |
|---|---|
|
|
Value to test |
|
|
Used when primary is empty (default) |
|
|
Optional |
|
Expression |
Kari's permission expiry |
Output |
|---|---|---|
|
|
empty |
|
|
|
|
|
|
|
Manager= |
`` (empty — reversed: fallback only when manager exists) |
Use: Default text for missing expiry, manager, or comment.
[EXISTS;value;resultIfNonEmpty]
|
Parameter |
Purpose |
|---|---|
|
|
Tested string |
|
|
Returned only if |
|
Expression |
Kari Manager field |
Output |
|---|---|---|
|
|
|
|
|
|
empty |
`` (empty) |
Use: Gate nested lookups — only run [REFERENCE...] when [Manager] is set.
[TRANSFORM;input;mapping...]
|
Parameter |
Purpose |
|---|---|
|
|
Value to map |
|
|
Match input to output |
|
|
Wildcard if no key matches |
|
Expression |
|
Output |
|---|---|---|
|
|
— |
|
|
|
— |
|
Use: HR codes → display text in messages.
[CONTAINS;valueList;targetList;ifYes;ifNo]
|
Parameter |
Purpose |
|---|---|
|
|
Pipe-separated needles |
|
|
Pipe-separated haystack |
|
|
Strings returned on match / no match |
|
Expression |
Output |
|---|---|
|
|
|
|
|
|
Use: Ruleset-style branching inside a template.
Array (pipe-separated) operations
Lists look like A|B|C. Many HR position fields use this shape.
[COUNT;ignored;list]
|
Parameter |
Purpose |
|---|---|
|
|
Placeholder (unused) |
|
|
Pipe-separated values |
|
Expression |
Output |
|---|---|
|
|
|
Use: "How many positions does this user have?"
[ARRAYAPPEND;list1;list2]
|
Expression |
Output |
|---|---|
|
|
|
Use: Merge role lists from two permission queries.
[ARRAYUNIQUE;list]
|
Expression |
Output |
|---|---|
|
|
|
Use: Deduplicate department ids before export.
[ARRAYFILTER;list;allowed]
Keeps only items that appear in allowed.
|
Expression |
Output |
|---|---|
|
|
|
Use: Whitelist position types for a message.
[ARRAYDIFF;current;previous]
Items in current not in previous.
|
Context |
|
|
Output |
|---|---|---|---|
|
New position added |
|
|
|
|
No change |
|
|
`` |
Use: Detect new position in message flow (pair with [LASTVALUE;APositionCodeId]). Warning: unreliable if several positions change in one import.
[ARRAYJOIN;list1;list2]
Zips two lists by index.
|
Expression |
Output |
|---|---|
|
|
|
Use: Combine parallel columns for CSV-style export lines.
[ARRAYFOREACH;array;template] / [ARRAYFOREACH;array;separator;template]
Iterates over a pipe-separated list. For each non-empty element, substitutes ??? with the element and ???i with its 0-based index in the template, evaluates nested [...] in the template, then joins results.
|
Parameter |
Purpose |
|---|---|
|
|
Pipe-separated list (often a field like |
|
|
Optional join string between iterations (default |
|
|
Text or nested expression; |
|
Expression |
Kari |
Output |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Empty pipe segments are skipped (same convention as [ARRAYUNIQUE] / [ARRAYPREFIX]).
Not supported: [ARRAYFOREACH...] nested inside another [ARRAYFOREACH...] — expression evaluation fails. Use two sibling calls or [ARRAYJOIN] instead.
Use: Format each position as its own line in a message; prefix each unit id for export.
[ARRAYPREFIX;list;mode;text]
|
Parameter |
Purpose |
|---|---|
|
|
Pipe-separated items |
|
|
|
|
|
Prefix or suffix string |
|
Expression |
Output |
|---|---|
|
|
|
Use: Namespace external ids.
[ARRAYTRIM;list;delimiter;maxCount]
|
Expression |
Output |
|---|---|
|
|
|
Use: Only first N positions in a summary mail.
[PRUNEARRAY;list;regex;reverse]
|
Parameter |
Purpose |
|---|---|
|
|
Pipe-separated items |
|
|
.NET regular expression |
|
|
|
|
Expression |
Output |
|---|---|
|
|
|
|
|
|
Use: Drop temporary position codes from export.
[UNION;headers;list1;list2;...]
Merges parallel lists row-wise into spaced/pipe combined rows.
|
Expression |
Conceptual output |
|---|---|
|
|
|
Use: Multi-column text blocks in reports.
Random, hash, uniqueness
[RND;min;max]
|
Parameter |
Purpose |
|---|---|
|
|
Minimum integer (inclusive) |
|
|
Maximum integer (exclusive in practice — test your range) |
|
Expression |
Example output |
|---|---|
|
|
|
Use: Ticket numbers in test templates.
[STRRND;minLen;maxLen;chars]
|
Parameter |
Purpose |
|---|---|
|
|
Length range |
|
|
Allowed character set (empty = alphanumeric default) |
|
Expression |
Example output |
|---|---|
|
|
|
Use: One-time codes when password rule is not used.
[PASSWORD;ruleId]
|
Parameter |
Purpose |
|---|---|
|
|
Id of password generation rule configured in eADM |
|
Expression |
Output |
|---|---|
|
|
e.g. |
Use: Initial password in welcome message — handle securely.
[HASH;text]
|
Expression |
Output (example) |
|---|---|
|
|
32-character MD5 hex string (fixed for same input) |
Use: Opaque tokens in links (not for security-critical hashing alone).
[UNIQUE;base;fieldName;replacement]
Ensures base does not already exist in fieldName on another object; appends 2, 3, … or inserts before replacement.
|
Parameter |
Purpose |
|---|---|
|
|
Proposed username or email |
|
|
Field to check uniqueness against (e.g. |
|
|
Optional suffix marker to replace with number |
|
Scenario |
Expression |
Output |
|---|---|---|
|
|
|
|
|
|
same |
|
Use: Customer setup username expression together with [CLEAN] / [LOWER].
Database lookup and relations
These read live eADM data for the customer. Ids must exist in your environment.
[REFERENCE;returnField;whereField;objectTypeId;searchValue;exactMatch]
|
Parameter |
Purpose |
|---|---|
|
|
Field(s) to return from matched object ( |
|
|
Field to match on |
|
|
|
|
|
Value to find |
|
|
|
|
Expression |
Dummy match |
Output |
|---|---|---|
|
|
Dept id 2100 = IT |
|
|
|
Manager user |
|
Use: Department number from permission ManagerOf id:
[REFERENCE;OrgUnitnr;Id;2;2100]
[OBJECTPERMISSION;returnField;whereField;filterValue;exactMatch;aggregate]
Reads permissions on the current user.
|
Parameter |
Purpose |
|---|---|
|
|
Permission field (Comment, ManagerOf, ExpiryDate, SystemRoleId, …) |
|
|
Field to filter on |
|
|
Match value, or |
|
|
String match mode |
|
|
|
|
Expression |
Output (Kari) |
|---|---|
|
|
|
|
|
|
Shorthand for role name:
|
Expression |
Output |
|---|---|
|
|
|
[OBJECTHISTORIES;returnField;whereField;filterValue;exactMatch;aggregate]
Reads object history on current user (audit trail from sync/UI).
|
Example filter |
Expression |
Typical output |
|---|---|---|
|
Last permission add |
|
|
Use: "Who assigned this permission?" in message flows (often nested in [SPLIT] / [REFERENCE]).
[FOREACH;collection;query;returnFields;headers;format]
|
Parameter |
Purpose |
|---|---|
|
|
|
|
|
Filter (company scope added automatically) |
|
|
Comma-separated fields, optionally |
|
|
Column titles for csv/html |
|
|
|
Example (conceptual): All users with role 501, CSV:
[FOREACH;objectpermission;SystemRoleId=501;object.DisplayName,object.Email;Name,Email;csv]
Output (dummy):
Name,Email
Kari Nordmann,kari.nordmann@eksempel.kommune.no
Ola Hansen,ola.hansen@eksempel.kommune.no
Use: Manager report embedded in email body.
[DESCENDANTS;rootId;returnField;parentKey;foreignKey]
|
Parameter |
Purpose |
|---|---|
|
|
Department object id to start from |
|
|
Field to collect from each node |
|
|
Child field pointing to parent (e.g. |
|
|
Parent identifier field (e.g. |
|
Start |
Tree |
Expression |
Output |
|---|---|---|---|
|
IT id |
IT → HR |
|
|
Use: All sub-departments for scope on a manager permission.
[SYSTEM;type;id;field]
|
Parameter |
Purpose |
|---|---|
|
|
|
|
|
Numeric id or |
|
|
Field name(s) to return |
|
Expression |
Output (dummy) |
|---|---|
|
|
|
|
|
|
Use: System owner contact in admin notification.
[SELECTION;rulesetId;returnField]
|
Parameter |
Purpose |
|---|---|
|
|
Ruleset to evaluate per object |
|
|
Field from each object that matches |
|
Expression |
Output (dummy) |
|---|---|
|
|
|
Use: Mailing list of everyone matching "New starters" ruleset.
[AVAILABLESYSTEM;field] / [AVAILABLEROLE;systemId;field]
Returns pipe-separated values for systems or roles that pass their Available for ruleset on the current user.
|
Expression |
Meaning |
|---|---|
|
|
Names of systems Kari may receive permissions for |
|
|
Role names on system 12 she may be assigned |
Use: Dynamic pick lists in forms or messages.
[AVAILABLEDEPARTMENTS;fields;targetUserId]
|
Parameter |
Purpose |
|---|---|
|
|
Comma-separated department fields |
|
|
User to evaluate; empty = current object |
Use: List departments a manager may administer (from ManagerOf, unit ids, mega.eadm.no roles).
[DATAOWNER;returnField]
Follows data-owner relation on object; returns field from owner.
|
Expression |
Output (if owner group name stored) |
|---|---|
|
|
|
[ANTECEDANTS.SYSTEMROLE;roleId;departmentId;returnField]
Managers holding roleId on ancestor departments of departmentId.
|
Expression |
Output (dummy) |
|---|---|
|
|
|
Use: Escalation mail when HR child dept has no local approver.
[COUNTEMPLOYEE] / [COUNTMEMBERS]
Evaluated on department or group object respectively.
|
Object |
Expression |
Output (dummy) |
|---|---|---|
|
Department IT |
|
|
|
Group "Prosjekt Alfa" |
|
|
[GETLASTSYNCID]
|
Expression |
Output (dummy) |
|---|---|
|
|
|
Use: Troubleshooting footers in admin mails.
[LASTVALUE;attributeName]
Previous value of field from last import HR history, else current field.
|
Context |
Expression |
Output |
|---|---|---|
|
Before sync Kari had one position |
|
|
|
After adding POS-02 |
|
|
Pair with [ARRAYDIFF;[APositionCodeId];[LASTVALUE;APositionCodeId]] → POS-02|.
Positions (multi-position HR)
Position fields share index across pipes: index 0 = first position, 1 = second.
[POSITION;returnField;whereField;matchValue]
|
Parameter |
Purpose |
|---|---|
|
|
Position field to return (e.g. |
|
|
Field to match (e.g. |
|
|
Unit or code to find |
|
Expression |
Output |
|---|---|
|
|
|
|
|
|
[POSITIONS;returnField;whereField;matchValue]
Same as [POSITION] but returns aligned pipe string across all positions (empty slot where no match).
|
Expression |
Output |
|---|---|
|
|
|
[GROUPPRIMARYPOSITION;returnField]
Picks primary position: highest APositionPercentage, tie-break by earliest APositionStartDate.
|
Kari positions |
Expression |
Output |
|---|---|---|
|
100% IT, 20% HR |
|
|
[ACTIVEPOSITIONCOUNT;asOfDate]
|
Expression |
Output |
|---|---|
|
|
|
Messaging and integration
[COUNTMESSAGESENT;messageId;fromDate]
|
Parameter |
Purpose |
|---|---|
|
|
Message template id. Optional — if omitted (equal to |
|
|
Only count sends after this date (optional) |
|
Expression |
Output (dummy) |
|---|---|
|
|
|
Omitted messageId: If the message template id is not given ([COUNTMESSAGESENT;] is equal to 0), the expression evaluates in the context of the message template whose sending triggered the rule set. In other words it resolves to "has the message currently being sent already gone out to this recipient", not to any single fixed template id. Because of this, the same rule set can be reused as the duplicate-send guard for several different message templates, instead of building a separate rule set per template.
Warning: Preview of the rule set in the expression builder will not work when messageId is omitted, because outside an actual message send there is no triggering message template to supply that context.
Use: "Already notified?" guard in follow-up flow; shared duplicate-send guard across multiple message templates.
[SYSTEMOWNER]
Requires history row from permission change (Add/Edit/Delete permission).
|
Context |
Output (dummy) |
|---|---|
|
Permission on role 501 added |
|
Use: CC system owner when automated permission is granted.
[SYNCSTEPPARAMETER;key;companySyncStepId]
|
Parameter |
Purpose |
|---|---|
|
|
Parameter name on sync step |
|
|
Customer sync step instance id |
|
Expression |
Output |
|---|---|
|
|
|
Access: Company administrator in expression builder preview.
[APITOKEN;apiUsername]
|
Parameter |
Purpose |
|---|---|
|
|
API user login name (object type 14) |
|
Expression |
Output |
|---|---|
|
|
Opaque session token string (varies) |
Access: Company administrator in preview. Use only in secured server-side flows.
HTML helpers (message templates)
[HTMLLISTMEMBEROF;displayField]
On a group member user: lists parent groups.
|
Expression |
Output |
|---|---|
|
|
|
[HTMLLISTARRAY;list]
|
Expression |
Output |
|---|---|
|
|
|
Form template controls
Used in form templates, not standard rulesets.
|
Function |
Purpose |
|---|---|
|
|
Text input bound to form field id |
|
|
Boolean input |
|
|
Dropdown (five parameters) |
|
|
Radio group |
|
|
Date picker |
|
|
Multi-line text |
|
|
Action button |
Example pattern: [INPUTBOX;1042;Avdeling;IT-100;] renders input labelled "Avdeling" defaulting to IT-100.
Markers [NOTIFY...], [HIDDEN...], [SERVERFUNCTION...] are form behaviour hooks, not data functions.
End-to-end scenarios (dummy data)
Welcome mail — start date only
Ny ansatt [DisplayName] starter [SUBSTRING;0;10;[Start]].
Output: Ny ansatt Kari Nordmann starter 01.04.2026.
Permission expiry line
Gyldig til: [IFEMPTYUSE;[OBJECTPERMISSION;ExpiryDate;SystemRoleId;501];Permanent tilgang]
Output: Gyldig til: Permanent tilgang
Manager missing — escalate to parent dept manager
[IFEMPTYUSE;
[EXISTS;[Manager];];
[REFERENCE;Email;UserId;1;[REFERENCE;Manager;Id;2;[REFERENCE;ParentDepartmentNumber;DepartmentNumber;2;[DepartmentNumber]]]]]
|
Kari Manager |
Output |
|---|---|
|
empty |
|
|
set |
empty (EXISTS branch — adjust template logic if you need manager email when present) |
Adjust IFEMPTYUSE/EXISTS pairing to match your template intent; test in expression builder.
New position only — message recipient
After sync adds POS-02:
[REFERENCE;Email;UserId;1;[POSITION;APositionManager;AUnitId;[RTRIM;[ARRAYDIFF;[APositionCodeId];[LASTVALUE;APositionCodeId]];|]]]
Output: Manager email for the new position's unit (dummy: ny-leder@eksempel.kommune.no).
Auto security group name (customer setup)
SG-[Department]-[CLEAN;[OrgUnitnr]]
Output: SG-IT og digitalisering-IT-100 (exact CLEAN output may vary).
Export mapping — samAccountName
[UserName]
Output: kari.nordmann
Ruleset — user has role on system
Rule attribute expression:
[OBJECTPERMISSION.SYSTEMROLE;Name;SystemRoleId;501]
Resolved value: Bruker Fagsystem X — compare with operator Er lik / membership operators.
Expression builder
|
Item |
Detail |
|---|---|
|
Where |
Header icon expression builder, message template editors, some eHub screens |
|
Function list |
All object fields for selected type plus standard functions |
|
Preview |
Pick test user/department/group; requires super manager |
|
Rulesets |
Automation → Rulesets — minimum super manager |
Two entry modes for a rule condition value
Each condition row in a ruleset's Rules tab has an Attribute (or Argument) field with two small icons that toggle its entry mode:
-
Dropdown mode (up/down arrows icon) — the default. Presents a searchable dropdown of the object's attribute values, grouped by type (user, group, department, or form attributes, depending on what the ruleset is used with).
-
Free-text mode (keyboard icon) — switches the field to a plain text box. Use this to type hardcoded text, or a function expression using the bracket syntax described earlier in this article, e.g.
[COUNTMESSAGESENT;7166].
Free-text mode still offers autocomplete: typing a partial function or field name (e.g. [count) surfaces matching attributes and functions, such as [COUNTEMPLOYEE], [COUNTMEMBERS], and [COUNTMESSAGESENT;message id].
Testing an expression with Edit expression
When a condition field is in free-text mode, an additional icon next to it opens the Edit expression dialog. Use it to test a function expression against a real object before saving the rule.
The dialog shows:
-
Object type — the ruleset's primary object type (e.g. User) and which secondary contexts are available (Function, Function alias, Event, History).
-
Context — a test object to evaluate against. Use Search to pick a specific object, or Choose randomly to let eADM select one.
-
Expression — an editable text area, pre-filled with the condition's current expression.
-
Result — the evaluated output, shown after clicking Execute.
While editing, hovering over a function inside the expression shows a help tooltip with that function's full syntax, a short description, and the meaning of each parameter. The tooltip highlights the whole expression in green and shows the part corresponding to the current cursor position in bold, which makes it considerably easier to navigate long or deeply nested expressions.
Note: As with the expression builder generally, testing an expression in Edit expression requires Administrator access (see Access levels above).
Troubleshooting
|
Symptom |
Likely cause |
Action |
|---|---|---|
|
Literal |
Inner field empty or typo |
Fix nesting; verify field names on object |
|
Expression evaluation error |
Nested |
Split into sibling calls or use |
|
Empty string |
No matching id / permission |
Confirm system role id and system id in system access |
|
Wrong position in mail |
Several positions changed at once |
Do not rely on ARRAYDIFF/LASTVALUE alone |
|
Preview blocked |
Role or protected field |
Elevate role or simplify test expression |
|
Works in builder, not in message |
Event flow needs object history from sync |
Run import; check entry type in history |
|
Preview does not run / breaks silently |
|
Expected — the triggering message template context only exists during an actual send. Test the surrounding logic without this condition, or temporarily supply a real |
Quick index
|
Category |
Functions |
|---|---|
|
Date/time |
NÅ, NOW, DATEFORMAT, DATEDIFF, DAYOFYEAR |
|
String |
SUBSTRING, SPLIT, REPLACE, REPLACELIST, RTRIM, LTRIM, RPAD, LPAD, RIGHT, INITIALS, PRETTIFY, LOWER, UPPER, CLEAN, STRICTCLEAN, CNCLEAN, GETKEYVALUE |
|
Logic |
IFTHENELSE, IFEMPTYUSE, EXISTS, TRANSFORM, CONTAINS |
|
Arrays |
COUNT, ARRAYAPPEND, ARRAYUNIQUE, ARRAYFILTER, ARRAYDIFF, ARRAYJOIN, ARRAYFOREACH, ARRAYPREFIX, ARRAYTRIM, PRUNEARRAY, UNION |
|
Security |
HASH, PASSWORD, UNIQUE, RND, STRRND |
|
Lookup |
REFERENCE, OBJECTPERMISSION, OBJECTHISTORIES, FOREACH, DESCENDANTS, SYSTEM, SELECTION, AVAILABLESYSTEM, AVAILABLEROLE, AVAILABLEDEPARTMENTS, DATAOWNER, ANTECEDANTS.SYSTEMROLE, COUNTEMPLOYEE, COUNTMEMBERS, GETLASTSYNCID, LASTVALUE |
|
Positions |
POSITION, POSITIONS, GROUPPRIMARYPOSITION, ACTIVEPOSITIONCOUNT |
|
Messaging |
COUNTMESSAGESENT, SYSTEMOWNER, SYNCSTEPPARAMETER, APITOKEN |
|
HTML |
HTMLLISTMEMBEROF, HTMLLISTARRAY |
|
Forms |
INPUTBOX, CHECKBOX, BUTTON, LISTBOX, RADIO, DATEBOX, AREABOX |
AI assistant notes
-
Prefer
[DisplayName]-style fields before wrapping in functions. -
Ask where the expression lives: ruleset vs message vs export vs customer setup.
-
Replace dummy ids (
501,2100) with the customer's real system role and department ids from system access. -
Position filter on import excludes matches; sync step ruleset includes matches.
-
Event message flows need object history from a sync run.
-
Build nested examples inside-out — except
[ARRAYFOREACH...], which binds???per element before template functions run. -
Do not nest
[ARRAYFOREACH...]; use sibling calls or[ARRAYJOIN]. -
[COUNTMESSAGESENT;]with themessageIdomitted evaluates against the message template currently sending, so one rule set can gate several message templates — but its preview will not work outside a real send. -
Two ways to set a rule condition's value: dropdown (attribute picker) or free text (keyboard icon, hardcoded text or expressions), with Edit expression available in free-text mode to test against a sample object.
-
Terms: ruleset (Regelsett), message flow (meldingsflyt), system access (systemtilgang), permission (tilgang), object history (objekthistorikk).