
ulazx (ulazx) asked a question.
I am trying to build an expression that pulls from an attribute that could have different values depending on a users department and then add the user to an Okta group.
For example:
attribute: costcenter
values could be: 0001234 IT - Admin, 0005678 IT - User, 0009876 IT - RemoteUser
I would like the xpression to look at the costcenter values and read at minimum the number from each value and then put that user into an Okta group.
i had something like String.startsWith(user.costcenter,"xxxxxxx) and where the X's are is what I am missing but I might be totally wrong with the entire expression already.

Are you trying to put users from multiple cost centers into a single group, or do you a group for each cost center? I don't see a "startsWith" function in the OEL (https://developer.okta.com/docs/reference/okta-expression-language/#string-functions), but there's "stringContains" and "substring" functions that should work for you.