
lo7ab (lo7ab) asked a question.
We have a few apps (namely Salesforce) that use TimeZone and Locale but we don't have either set in our source directory, Active Directory.
I appreciate I can add entries to AD and then map that back to Okta and have that push to my Apps but I'm looking at a way to automate this without needing to add additional fields in AD and updating all my users.
We only have two time zones to worry about, Europe/London and Europe/Dublin. Each users' profile already has the country set as part of "countryCode" so I was thinking we could use Expression Language to define the Time Zone based on "countryCode".
For example, the following would set the timezone to London unless they had a countryCode of IE:
If "countryCode" is "IE" Then
Set timezone = "Europe/Dublin""
Else
Set timezone = "Europe/London"
End If
In a similar vein, I would also set the locale in the same way:
If "countryCode" is "IE" Then
Set locale = "English (Ireland)"
Else
Set locale = "English (United Kingdom)
End If
The above would be placed in the Directory Integration for AD, under the "Okta Attribute Mappings" section for both Time Zone & Locale attributes, set to Expression.
Can Okta Expression Language do what I'm trying to achieve and provide some sample code that I can play with?

Hi @lo7ab (lo7ab),
Thank you for posting on the Okta Community page!
I have done some research on my end and I have managed to find the bellow documentation about Okta Expression Language that contains conditional expression which may help you achieve your use case:
You should be able to achieve this by using something similar as the bellow expression that I have tried to built:
If we add the above expression to a mapping for the locale attribute from Okta to AD, it should send the value "English (Ireland)" towards AD if the country code attribute has the "IE" value and if it does not contain this value therefore it should send "English (United Kingdom)".
There are a few more examples in the documentation provided above along with more details about Expression Language that might help you achieve your use case.
I hope the above information is helpful!