<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
0D54z00009fLIUACA4Okta Classic EngineIntegrationsAnswered2024-05-03T09:01:24.000Z2023-09-14T13:05:04.000Z2023-10-18T15:41:10.000Z

l9v5m (l9v5m) asked a question.

OEL for email using preferred.Name.lastname if the value for preferred.Name is filled in from BambooHR

Hello,

I'm trying to get a BambooHR integration set up with Okta. BambooHR is our source of truth.

I have custom fields in BambooHR: preferred.Name and custom.preferred.Surname. Our username/email format is firstname.lastname@domain.com.

I'd like to have the email address created with the Preferred Names only if they exist when imported from BambooHR, and revert to the standard First and Last Name fields if either or both are blank.

For example, a user's name is Hollis Flax. Her preferred first name is Holly, so her email will be holly.flax@domain.com.

Or, Michael Scott's preferred first and last names are Mike Scarn, so his email would be mike.scarn@domain.com.

I hope that makes sense - would appreciate any and all help!

Thank you!


  • MatthewH.10249 (State of Iowa)

    Go to Profile Editor for your BambooHR app and edit the "app to Okta" mappings for the attribute in Okta you want the crated email and use an expression like the following.

     

    preferred.Name + preferred.Surname != null ? preferred.Name + "." + preferred.Surname + "domain.com" : appuser.Firstname + appuser.Lastname

     

    The above expression has some pitfalls should either the preferred name or surname is null but the other has a value. If you know you will always have both "preferred" values then this is enough. If not you can combat by creating an expression with nested ternary operator calls like the following.

     

    toLowerCase(pfn != null ? (psn != null ? pfn+psn : pfn+ln) : (psn != null ? fn+psn : fn+ln))

     

    If all goes well you will get something like the following.

    Username Dwight Schrute has a preferred name of Recyclops, so his email would be recyclops.schrute@domain.com

    Username Creed Bratton has a preferred surname of Schneider, so his email would be creed.schneider@domain.com

     

    I added the toLowerCase method as your examples showed converting mixed case to lower.

    Expand Post
    Selected as Best
  • MatthewH.10249 (State of Iowa)

    Go to Profile Editor for your BambooHR app and edit the "app to Okta" mappings for the attribute in Okta you want the crated email and use an expression like the following.

     

    preferred.Name + preferred.Surname != null ? preferred.Name + "." + preferred.Surname + "domain.com" : appuser.Firstname + appuser.Lastname

     

    The above expression has some pitfalls should either the preferred name or surname is null but the other has a value. If you know you will always have both "preferred" values then this is enough. If not you can combat by creating an expression with nested ternary operator calls like the following.

     

    toLowerCase(pfn != null ? (psn != null ? pfn+psn : pfn+ln) : (psn != null ? fn+psn : fn+ln))

     

    If all goes well you will get something like the following.

    Username Dwight Schrute has a preferred name of Recyclops, so his email would be recyclops.schrute@domain.com

    Username Creed Bratton has a preferred surname of Schneider, so his email would be creed.schneider@domain.com

     

    I added the toLowerCase method as your examples showed converting mixed case to lower.

    Expand Post
    Selected as Best
This question is closed.
Loading
OEL for email using preferred.Name.lastname if the value for preferred.Name is filled in from BambooHR