<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
0D54z00009WkU7OCAVOkta Classic EngineUniversal DirectoryAnswered2023-08-02T15:41:17.000Z2023-08-01T21:33:51.000Z2023-08-02T15:40:43.000Z

ChristopherS.22060 (Customer) asked a question.

Using UTC date/time with Okta Expression Language for group membership rule

Hello. I am attempting to use Okta expression language in a group rule, specifically using time. Everything indicates that this should be possible, including this kb article:

 

https://support.okta.com/help/s/article/creating-a-group-rule-based-on-user-account-creation-date?language=en_US

 

I have a custom attribute (user.startDate) that is in UTC format. I essentially want the group membership to trigger only if the current time [Time.now()] is past the start date attribute.

 

I have tried many formats, yet consistently get a message that I have errors in my constructs.

 

Can anyone please help me get the syntax correct?


  • DonF.81354 (Customer)

    Hi! I might be wrong, but I read that in saying that an attribute will either be a string or a boolean based upon the evaluation they provided. Meaning, lets say in the profile editor you have what they provided and you get "True" as a result. From that value you would be able to create the group rule. Thus anyone with "True" for the attribute specified would be placed into the group. Is that what you are currently using? The group rules would be based off of the value of the attribute, the profile editor is where the evaluation and result would take place, thus writing to the profile.

     

    Thanks!

    Expand Post
  • Mihai N. (Okta, Inc.)

    Hi @ChristopherS.22060 (Customer)​ , Thank you for reaching out to the Okta Community!

     

    I ran a test to validate the Okta Expression language syntax via attribute mappings in a test app using the following example:

     

    (Time.now()) > user.CustomStartDate ? "success" : "fail"  

     

    →this resulted in a success confirming that the (Time.now()) > user.CustomStartDate expression would result in a boolean output. 

     

    However, the same syntax is not supported in the Group Rules. 

    The documentation is not specific enough (in my opinion) when it comes to constrains that apply here. 

     

    I was unable to find any definitive answer to limitations that might apply, for example why some time functions would work (i.e. the doc you mentioned) while others do not. 

     

    I would recommend opening a case to work with one of our Support Engineers to get a definitive answer and if it turns out it's definitely not supported, then perhaps get a documentation update on the Group Rules/Okta Expression Language side for clarity.  

     

     

    If my answer helped, remember to mark it as best to increase its visibility for other members of the Okta Community who might have the same questions as you. 

     

    Hope my answer helps! 

    --------------------------------

    💡 Community Moderator Tip: Join a group today and connect with other Okta customers by region or product.

    Expand Post
This question is closed.
Loading
Using UTC date/time with Okta Expression Language for group membership rule