Lookups
You can use lookups within your projects to find values in the OU you are currently connected to or in a different OU.
LOOKUPA & LOOKUPB functions are disabled for the Group Members connector. However you can use the drag and drop lookup if it is required.
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.
If Active Directory is the target datasource then you can do this using calculated columns and a LOOKUPB expression. If Active Directory was the source then you would 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("DS-DN", "LDAP://DC01/OU=Managers,DC=demo,DC=simego,DC=com", WHEN("DS-SAMAccountName", Manager))
The quoted "DS-DN" is the column we are looking to return from Active Directory. This is the distinguished name of the manager.
Next is the LDAP Path to the OU 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 SAMAccountName 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. To use Employee IDs the lookup function would look similar to this:
LOOKUPB("Distinguished Name", "LDAP://DC01/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 within the same OU. Data Sync will do a lookup automatically within the DS-Manager columns, where you can match the corresponding manager column to the data type in the source records (e.g. EmployeeID, SAMAccountName etc.)
However if you would like to configure this manually you can do so with calculated columns and a LOOKUP function. In this example because 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 details.
Your lookup expression will be similar to:
LOOKUPB("DS-DN", "", WHEN("DS-SAMAccountName", Manager))
The quoted "DS-DN" is the column we are looking to return from Active Directory. This is the distinguished name of the manager.
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 SAMAccountName 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. To use Employee IDs the lookup function would look similar to this:
LOOKUPB("DS-DN", "", WHEN("EmployeeID", Manager)
Troubleshooting
If your lookup is not returning results or some records are not being updated, then your manager may not exist in your active directory yet.
If this is the case, and you are adding new users, you can run the project again and so long as the manager needed was included in the additions the manager field will be marked as an update item. This will happen once the manager exists within your Active Directory OU.