<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
0D54z0000A4PmrUCQSOkta Classic EngineLifecycle ManagementAnswered2026-03-16T09:00:23.000Z2024-03-28T13:08:18.000Z2024-03-28T15:56:03.000Z

DarylS.93577 (Customer) asked a question.

Use Expression language to extract first initial and last name from AD Manager DN

Im trying to bring our managers into Okta in a readable format to push to other apps. They are imported as a DN. I have found this query that works on our one domain that uses firstname.lastname as the username format:

(appuser.managerDn == "" OR appuser.managerDn == null) ? null :

String.toLowerCase(substring(String.substringBefore(String.substringAfter((substring(user.firstName, 0, 1) + user.lastName), "="), ","), " ", ".")) + "@domain.com"

But for our other domain, I need to pull the first initial and the last name. I think this should get me close, but Im unable to figure out how to put it all together:

 

substring(user.firstName, 0, 1) + user.lastName


  • 7jv04 (7jv04)

    Hello!

    (appuser.FirstName[0] + appuser.LastName + '@domain.com') should work for you. If you want it all in lowercase you want to add String.toLowerCase. Hope that helps!

This question is closed.
Loading
Use Expression language to extract first initial and last name from AD Manager DN