Expression that can handle multiple AD domains Skip to main content
https://support.okta.com/help/answers?id=9062a000000xzisqag&refurl=http%3a%2f%2fsupport.okta.com%2fhelp%2fanswers
How satisfied are you with the Okta Help Center?
Thank you for your feedback!
How satisfied are you with the Okta Help Center?
1
2
3
4
5
Very Dissatisfied
Very satisfied
Enter content less than 200 characters.
Ask Search:
BHFSmor BHFSmorBHFSmor BHFSmor 

Expression that can handle multiple AD domains

I'm attempting to write an expression that returns an AD attribute value. I'm currently using "active_directory_1.externalId", but I now need to extend the expression to cover users from different AD domains. Is there a way to craft an expression that will return the value for externalID from whichever AD the user is in?
Jaypee ManansalaJaypee Manansala (Okta)
Hi Mark,

Thanks for reaching out Okta Community Portal.

Have you tried this expression:

"hasDirectoryUser() ? findDirectoryUser().active_directory_1.externalId : null" --check if user has an Active Directory assignment, and if so, return their Active Directory "active_directory_1.externalId"

Best,

JP Manansala