
CalvinL.13916 (Customer) asked a question.
Can Okta only handle one expression for attribute mapping? Can someone tell me why my expression returns "error evaluating expression"?
We have a "level" attribute in our Okta profile that we'd like to manipulate before sending to the app. The expressions work individually but when I paste the whole thing, I get an error. Is there a way for me to join these expressions together with an operator?
(user.costCenter=="40-275" OR user.managerEmail=="john.doe@test.com") ? String.replace(user.level, "E1", "EA, IT - Level 4") : String.replace(user.level, "E1", "Individual Contributor - Level 5") :
(user.costCenter=="40-275" OR user.managerEmail=="john.doe@test.com") ? String.replace(user.level, "E2", "EA, IT - Level 4") : String.replace(user.level, "E2", "Individual Contributor - Level 5") or
(user.costCenter=="40-275" OR user.managerEmail=="john.doe@test.com") ? String.replace(user.level, "E3", "EA, IT - Level 4") : String.replace(user.level, "E3", "Individual Contributor - Level 5") or
(user.costCenter=="40-275" OR user.managerEmail=="john.doe@test.com") ? String.replace(user.level, "E4", "EA, IT - Level 4") : String.replace(user.level, "E4", "Individual Contributor - Level 5") or
(user.costCenter=="40-275" OR user.managerEmail=="john.doe@test.com") ? String.replace(user.level, "E5", "EA, IT - Level 4") : String.replace(user.level, "E5", "Individual Contributor - Level 5") or
(user.costCenter=="40-275" OR user.managerEmail=="john.doe@test.com") ? String.replace(user.level, "E6", "EA, IT - Level 4") : String.replace(user.level, "E6", "Individual Contributor - Level 5") or
(user.costCenter=="40-275" OR user.managerEmail=="john.doe@test.com") ? String.replace(user.level, "E7", "EA, IT - Level 4") : String.replace(user.level, "E7", "Individual Contributor - Level 5") or
(user.costCenter=="40-275" OR user.managerEmail=="john.doe@test.com") ? String.replace(user.level, "E8", "EA, IT - Level 4") : String.replace(user.level, "E8", "Individual Contributor - Level 5") or
(user.costCenter=="40-275" OR user.managerEmail=="john.doe@test.com") ? String.replace(user.level, "E9", "EA, IT - Level 4") : String.replace(user.level, "E9", "Individual Contributor - Level 5") or
String.replace(user.level, "M4", "Manager - Level 3") or
String.replace(user.level, "M5", "Manager - Level 3") or
String.replace(user.level, "M6", "Manager - Level 3") or
String.replace(user.level, "M7", "Director - Level 2") or
String.replace(user.level, "M8", "Director - Level 2") or
String.replace(user.level, "M9", "Non-Lead VP - Level 1") or
String.replace(user.level, "M11", "Platform Lead")

Hi @CalvinL.13916 (Customer),
Thank you for posting on the Okta community page!
I have looked over the expression and it seems that there is a missing “or” after “String.replace(user.level, "E1", "Individual Contributor - Level 5")” therefore that might be one of the reasons why it’s throwing an error.
Additionally, you can try to capture a HAR file when the error it’s appearing since in the trace itself, it might show a more detailed/specific error message that can lead to the root cause of the issue. I have provided bellow a documentation on how to gather a HAR file trace:
I have also provided bellow a general documentation about expression language: