eADM

[UNIQUE] - Check if a Value is Unique

The [UNIQUE] This function is used to check whether a given value for an attribute already exists in eADM. It is very useful when creating aliases, email addresses, usernames, or similar attributes that must be unique.

If the value being tested already exists, the function automatically appends a sequential number (1, 2, 3, etc.) to the value to make it unique. For email addresses, the function includes an optional parameter to ensure this number is correctly placed before the "@" symbol and the domain.



Syntax

[UNIQUE;SearchValue;Attribute;EmailDomain]
  • SearchValue: The value you want to check for uniqueness.

  • Attribute: The attribute field in eADM you want to test SearchValue against (e.g., Email).

  • EmailDomain: An optional parameter used when generating email addresses. It ensures that any sequential number is added before the email domain, not at the end of the address.



Use Case - Generating a Unique Email Address

The [UNIQUE] This function is often combined with other functions to first generate a value and then ensure it is unique. The following expression generates an email address from a user's display name and then checks to ensure it is unique.

[UNIQUE;[LOWER;[REPLACE;[CLEAN;[displayname]]; ;.]]@utfjord.kommune.no;Email;@utfjord.kommune.no]


How It Works:

  1. The internal functions (CLEAN, REPLACE, LOWER) format the user's full display name into a standard email prefix, such as "anne.johansen".

  2. The@utfjord.kommune.no The domain is appended to form a complete email address.

  3. The UNIQUE The function then checks if "anne.johansen@utfjord.kommune.no"already exists in the Email attribute in eADM.

  4. If the address is already in use, the expression will return a numbered version, such as "anne.johansen1@utfjord.kommune.no". If it is not in use, it will return the original "anne.johansen@utfjord.kommune.no".


Note: Expressions like this are commonly used in export templates, for example, when provisioning users to Active Directory (AD).