mapping expressions Skip to main content
https://support.okta.com/help/answers?id=9062a000000bmrfqay&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 

mapping expressions

Is it possible to craft an expression that would check two user attributes? For example; if user.email is null, then map the user.firstname value; but if user.email is not null then map its value"? 
Best Answer chosen by BHFSmor BHFSmor
Kevin TurnerKevin Turner (Okta, Inc.)
Yes this is possible. If you look on http://developer.okta.com/reference/okta_expression_language/ and then search for "Ternary operator" you will find the option that you are looking for.

All Answers

Kevin TurnerKevin Turner (Okta, Inc.)
Yes this is possible. If you look on http://developer.okta.com/reference/okta_expression_language/ and then search for "Ternary operator" you will find the option that you are looking for.
This was selected as the best answer
BHFSmor BHFSmorBHFSmor BHFSmor
Hey Kevin, I used a few okta user attributes and tested with the previewer:
user.postalAddress == null ? 'user.email' : 'user.postalAddress'
I expected this to return my email address, but instead it returns the literal string "user.email". How can I make the expression engine rerturn those attribute values? 
 
BHFSmor BHFSmorBHFSmor BHFSmor
Duh, removed the ' ' and it's working. Thanks Kevin.