Tips & Tricks - Import superiors from the Active Directory

In this workshop we will demonstrate how you can transfer superiors when importing users with LDAP, if these have been assigned in the Active Directory (AD).

Configure replication job

Switch to the "User" module. Select the main menu "Users / User and group import".

Click on "Edit", to edit an existing connection, or on "Add", to create a new one.

In the next dialog, provide the connection with a name and select "LDAP" as the source. Simply click on "Next" for an existing replication.

Click on "Add" here. Provide a name

for the new replication xml. Select "Active Directory" as the template and click on "Next".

Scroll down to the entry <!-- Import of boss --> and remove the line "<!--" at the beginning of the block and --> at the end of it. This activates the block of code and automatically transfers the superior from the AD during the next replication job. Click on "OK" and follow the instructions from the wizard to finish configuring the replication job. The replication can be performed immediately in the last step.

Superiors in the user account

Once the replication has been performed successfully, the defined superiors will be shown on the Organization tab of each user account.

Use superior name in applications

In the Users module, the superior is stored in each user account only with their ID. To display the superior name in applications, please follow the steps below.

4.1. Drop-down list

In drop-down lists, the full name of the superior can be displayed and the ID saved. Go to the Entries tab in the properties dialog of the drop-down list and select "Use values from applications" as the data source and then select the application "User". Please select "(PK) (S) User ID" as the saved value. Choose "Full name" as the displayed value. This means that the name of the superior will be displayed instead of the ID in the browser.

So that the correct superior for the employee is displayed, a filter needs to be defined as well. Select "(PK) (S) User ID" as the data field once more. "Equals" should be chosen as the operation and "Current user" with the value "Superior ID" as the comparative value.

4.2. Edit field

If you do not need the name to be displayed in a form, you can simply use an edit field connected to an "integer" data field. As the default, select the option "User data" and then "Superior ID". This means the superior ID of the current user is automatically entered into the field when the page is loaded.

View table

To display the superior's name in view tables, add a data field with the superior ID as a column in the table properties and select "User information" as the control type. Then click on "Edit column". On the Options tab, activate the setting "Link to user information".

View field

To display the superior's full name in view fields, select "User information" in the Existing data field dialog when creating an element.