Skip to main content
Skip table of contents

How to Display the Department Associated with an Access Right

In some cases, you may need a message template to specify which department an access right is connected to. This is particularly useful when an employee holds multiple positions in different departments and receives department-specific permissions, for example, in a patient record system.

This guide provides a compound expression that returns both the name of the access right and the department it is linked to.


The Expression

You can use the following expression in a message template or test it in the Expression Builder.

CODE
[OBJECTPERMISSION.SYSTEMROLE;Name;Id;1634] - [PRETTIFY;[REFERENCE;Department;Id;2;[OBJECTPERMISSION;ManagerOf;RoleTypeId;1634]]]

Warning: This expression is an example. You must replace the number 1634 with the actual ID of the system role you want to reference.


How It Works

The expression consists of two parts separated by a hyphen:

  1. Access Right Name: [OBJECTPERMISSION.SYSTEMROLE;Name;Id;1634]

    • This part of the expression retrieves the name of the system role with the specified ID.

  2. Department Name: [PRETTIFY;[REFERENCE;Department;Id;2;[OBJECTPERMISSION:ManagerOf:RoleTypeId:1634]]]

    • This part looks up and returns the name of the department that the access right is linked to.


Example Output

When used in the Expression Builder or a message flow, the expression will produce a result similar to the following format: "Access Right Name - Department Name".

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.