<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
0D50Z00008G7UwmSAFOkta Classic EngineLifecycle ManagementAnswered2024-04-17T13:51:40.000Z2016-10-12T20:10:49.000Z2018-08-12T04:15:28.000Z
Okta Expression Language - Join strings based on multiple group memberships?

Is there a way to to set the value of a variable in profile mapping as a combination of strings based on membership in various groups?

 

For example, we have a string called Build_Office.  Values can be blank, one, or multiple semicolon-dilimted office locations in a given list (e.g. Iowa, Nebraska, etc.).  I would like to set this variable based on group membership.  For example if the user belongs to the group OktaSalesforceTestBOIowa the string should get a value of Iowa.  However, if the user is also a member of OktaSalesforceTestBONebraska, then the string should get set to a value of Iowa;Nebraska instead, and so on.

 

I can successfully set the value for a single group with this expression, but I'm having trouble figuring out how to conditionally join strings for a number of groups.

 
  1.  isMemberOfGroupName("OktaSalesforceTestBOIowa") ? 'Iowa' : '' 

  • klddd (klddd)

    Well, I actually found an answer to my own question after experimenting for awhile.  I'll share it here for anyone else who may have a similar need (or for suggestions for a better way to do it). 
    1.  String.join(";", isMemberOfGroupName("OktaSalesforceTestBOIowa") ? 'Iowa' : '', isMemberOfGroupName("OktaSalesforceTestBONebraska") ? 'Nebraska' : '')
     

    Expand Post
    Selected as Best
  • klddd (klddd)

    Well, I actually found an answer to my own question after experimenting for awhile.  I'll share it here for anyone else who may have a similar need (or for suggestions for a better way to do it). 
    1.  String.join(";", isMemberOfGroupName("OktaSalesforceTestBOIowa") ? 'Iowa' : '', isMemberOfGroupName("OktaSalesforceTestBONebraska") ? 'Nebraska' : '')
     

    Expand Post
    Selected as Best
This question is closed.
Loading
Okta Expression Language - Join strings based on multiple group memberships?