How to Display the Person Who Requested an Access Permission
Oversikt
In many notification scenarios, it's important to know who ordered an access permission, 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.
Uttrykket
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]]
Slik fungerer det
This solution works by nesting multiple expressions:
OBJECTHISTORIES
: This inner expression retrieves the username of the person who granted the access permission from a text-based log.REFERANSE
: This outer expression takes the username provided byOBJECTHISTORIES
and 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 permission to the user in a text-based log. If multiple administrators grant different permissions 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 permission mentioned in this notification.