<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
0D54z0000A6djecCQAOkta Classic EngineSingle Sign-OnAnswered2026-02-27T09:00:28.000Z2024-04-22T17:12:31.000Z2024-04-30T17:40:10.000Z

sogi1 (sogi1) asked a question.

okta expression language - trying to extract groups using an AND condition

 

Arrays.contains(access.scope, "groups-MEP-core") ? Groups.startsWith("active_directory","ldap-amw-abopayments-",100) AND Groups.endsWith("active_directory","-dev",100)


  • Mihai N. (Okta, Inc.)

    Hi @sogi1 (sogi1)​ , Thank you for reaching out to the Okta Community! 

     

    Please provide the context for the use of this expression as not everything is supported everywhere. 

    Also, is this for use in attribute mapping, group rules, something else? 

     

     

    Regards.

     

    --

    Help others in the community by liking or hitting Select as Best if this response helped you.

    Expand Post
    Selected as Best
  • Mihai N. (Okta, Inc.)

    Hi @sogi1 (sogi1)​ , Thank you for reaching out to the Okta Community! 

     

    Please provide the context for the use of this expression as not everything is supported everywhere. 

    Also, is this for use in attribute mapping, group rules, something else? 

     

     

    Regards.

     

    --

    Help others in the community by liking or hitting Select as Best if this response helped you.

    Expand Post
    Selected as Best
  • sogi1 (sogi1)

    we are using this in a claim to push back groups that a user is in. We want to send in the claim all the groups a user is in that starts with ldap-amw-abopayments- and ends with -dev .

  • sogi1 (sogi1)

    Thank you for your quick reply. i tried it just as you have it in the array.flatten and it still returns all groups a user is in that starts-with so its only listing all the startswith groups

    Image is not available

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

      Ok, so if Arrays.flatten worked for the first part, let's try a combination  

       

      Arrays.flatten(Groups.startsWith("active_directory","ldap-amw-abopayments-",100)) AND Arrays.flatten(Groups.endsWith("active_directory","-dev",100))

       

      If this does not work, I recommend opening a case to go over things with one my colleagues from the Support team.  

       

       

      Regards.

      --

      Help others in the community by liking or hitting Select as Best if this response helped you.

      Expand Post
  • sogi1 (sogi1)

    thank you for your help. This 'AND' statement works but it gives me the groups that start with and the groups that end with but it doesn't combine the too. What I am wanting is an also. groups that are

    ldap-amw-abopayments*-dev (anything after payments and ends with dev). thanks again for helping

    • Mihai N. (Okta, Inc.)

      Hmm, I would have said to use a regex function but that returns a boolean. 

      Unfortunately, I'm not seeing a way to achieve this.

      I recommend opening a case to go over things with one of my colleagues from the Support team.

       

       

      Regards.

      --

      Help others in the community by liking or hitting Select as Best if this response helped you.

      Expand Post
This question is closed.
Loading
okta expression language - trying to extract groups using an AND condition