IT data mapping for ADS container from custom field

Hello All,

we have a scenario, where employee can have a two Active Directory(AD) accounts from different domains. eg. Domain A and Domain B.

Primary domain user account ADS Container field is populated based on the Primary Department filed. we have done the IT data mapping for both account definition in Domain A and Domain B.

When user is having accounts in both the domains i.e. Domain A as a primary and B as a secondary, we assigned both the account definition to the employee. primary domain user account gets created property in correct OU as per the Account Definition IT data mapping i.e. via department. however, for the secondary domain account, the user account is created in default OU because department details which is require to select the ADS Container is given in the custom field. custom field is FK for department table.

how can i select department which is defined in the custom field to assign the correct OU.

Regards,

Prasad