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 "Users" 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. Click "Next".

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. Assign a name for the new Replications.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 "OK" and follow the further instructions of the wizard to finish configuring the replication job. The replication can be performed immediately in the last step.

Superiors in the user account

If the replication is successful, you will now find the assigned superiors in each user account on the "Organization" tab.

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.

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.

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, set the "Show link to user information" setting.

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.