Connectors

Lookups

You can use lookups within your projects to find values in the OU you are currently connected to or in a different OU.

Lookups Within a Different OU

If we take an example where you have managers stored in a separate OU to general users and you want to link the users to their corresponding manager.

To do this will need to lookup and return the distinguished name from your Manager OU.

You can do this using calculated columns and a LOOKUPB expression. We are going to use LOOKUPB as AD is our target, if AD was our source we could use LOOKUPA.

LOOKUPB has the following syntax:

object LOOKUPB(string column, FROM(from), keyValue)

object LOOKUPB(string columnName, LFROM from, params KVAL[] keyValues)

Example

To lookup a manager in another OU you would use a lookup expression similar to:

LOOKUPB("Distinguished Name", "LDAP://OU=Managers,DC=demo,DC=simego,DC=com", WHERE("Display Name", Manager)

Lookup Manager Different OU

The quoted "Distinguished Name" is the column we are looking to return from Active Directory. This needs to match the column name that is defined in the properties collection manager under Name.

We then specify the LDAP Path to the OU we want to look for the record in.

Then we specify a WHEN clause to define what the parameters are that need to be matched. This is the link between the source and the target. In this example is it the Display Name of the Manager in Active Directory to the Manager Field in the source columns. This could also be achieved using employee numbers if that is what is returned for your Source Manager column.

LOOKUPB("Distinguished Name", "LDAP://OU=Managers,DC=demo,DC=simego,DC=com", WHEN("EmployeeID", Manager)

Lookups Within the Same OU

If we take the same example as above, needing to lookup managers and link them to the user accounts being added, we can do this in a similar way. As our managers and users are all stored within the same OU, we can leave the LDAP path blank so that it uses the current connection.

Your lookup expression will be similar to:

LOOKUPB("Distinguished Name", "", WHERE("Display Name", Manager)

Lookup Manager Same OU

The quoted "Distinguished Name" is the column we are looking to return from Active Directory. This needs to match the column name that is defined in the properties collection manager under Name.

We then leave the LDAP Path empty so that it uses the path we are currently connected to.

Then we specify a WHEN clause to define what the parameters are that need to be matched. This is the link between the source and the target. In this example is it the Display Name of the Manager in Active Directory to the Manager Field in the source columns. This could also be achieved using employee numbers if that is what is returned for your Source Manager column.

LOOKUPB("Distinguished Name", "", WHEN("EmployeeID", Manager)

Troubleshooting

If your lookup is not returning results, please check the attribute Name field you are using to match the items in the property collection manager. Your attribute may or may not have a space between words.

Please also check that there are no additional spaces added at the end of the Name of either the attribute you are trying to return or the attribute you are trying to match on.

Alternatively your manager may not exist in your active directory yet. If this is the case you can run the project again and it will set the manager field as an update item once the manager exists in AD.