Setting Multiple Possible Values for AD/LDAP Profile Attributes
Last Updated:
Overview
We have a requirement to check if a new Active Directory attribute: otherEmail has a value then use this value to map to the 'email' field otherwise if the new Active Directory attribute: otherEmail is empty (null) then map the 'email' field to the value of Active Directory Email attribute.
i.e.
If Active Directory otherEmail = $null
then email = Active Directory Email
else email = Active Directory otherEmail
Applies To
- AD/LDAP
- Profile Attributes
Solution
You'd want to do something similar to the following:
emails: raw_data.otherEmail ? [{value: raw_data.otherEmail }] : (raw_data.mail ? [{value: raw_data.mail }] : undefined)