<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
System Status
Announcements
Announcements
Search
Search
Select Language
0D54z00006vBWCPCA4Okta Classic EngineUniversal DirectoryAnswered2021-04-19T20:54:15.000Z2021-04-16T19:04:25.000Z2021-04-19T20:54:15.000Z

BrianR.50917 (Customer) asked a question.

Nested Ternary Operators

Has anyone had any luck with nesting Ternary Operators to handle multiple options for an attribute?

 

I.E.

 

Eval 1 ? value if true : value if false

Eval 2 ? value if true : value if false

Eval 3 ? value if true : value if false

 

The idea is that we have multiple options, up to 6, that this field could have a value for. Individually the operators work but have not been able to group them together to result in valid fields.


  • Hi Brian,

    You could try something like this (change the conditions): isMemberOfGorupName("administrator") ? "role1" : (isMemberOfGorupName("management") ? "role2" : "role3").

    I noticed that you already have a support case open for this type of problem. Please feel free to update the Support Case if you continue to have issues about this, or open a new case with Support if this is a different issue.

    Expand Post
This question is closed.
Loading
Nested Ternary Operators
Okta Support Agent (Beta)

Terms of Service

Hello! I'm the Okta Support Agent (Beta), your go-to resource for questions about Okta products. Please remember for your security and privacy, do not share any Personally Identifiable Information (PII) such as passwords, IP addresses, or other details with me.

Okta Privacy Policy and Terms of Service apply