How to Display the Person Who Requested an Access Right
Overview
In many notification scenarios, it's important to know who ordered an access right, not just who received it. This can be critical for auditing and clarifying requests.
You can display the name of the requester in a message template by using a specific nested expression.
The Expression
To retrieve the name of the person who initiated the access change, use the following expression:
[REFERENCE;DisplayName;UserName;1;[SPLIT;[OBJECTHISTORIES;Comment;EntryType;AddPermission];;4]]
How It Works
This solution works by nesting multiple expressions:
OBJECTHISTORIES: This inner expression retrieves the username of the person who granted the access right from a text-based log.REFERENCE: This outer expression takes the username provided byOBJECTHISTORIESand looks up the person's full display name.
Example in a Message Template
You can embed this expression directly into a sentence in your message flow.
Template Code:
[displayname] has received a user account at [department] and requires access to HK Oppvekst. The access was ordered by [REFERENCE;DisplayName;UserName;1;[SPLIT;[OBJECTHISTORIES;Comment;EntryType;AddPermission];;4]].
Final Output: The rendered message will look like this:
Anne Helgesen has received a user account at PPT and requires access to HK Oppvekst. The access was ordered by Roar Kjakkevik.
Warning: This expression has a limitation that can occur in rare situations. The expression works by looking up the last person who added a right to the user in a text-based log. If multiple administrators grant different rights to the same user before the next synchronization cycle runs, the expression may return the name of the last administrator to act, which might not be the one who granted the specific right mentioned in this notification.