<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
0D5KZ00001Wbdxn0ABOkta Identity EngineWorkflowsAnswered2025-11-19T15:40:36.000Z2025-11-15T03:37:54.000Z2025-11-19T15:39:44.000Z

Pratula.69048 (Customer) asked a question.

Generate and Validate unique email prefix across multiple suffix

Bit of a broad question - but am stuck at trying to generate an unique email for a new user. Am able to generate the suffix using necessary conditions as well as the prefix as FN.LN.

 

The prefix validation from Okta UD is where am struggling. Trying to configure logic to do FN.LN1, FN.LN2 etc. if prefix already exists. (Prefix should be unique across multiple suffixes - cannot have john.doe@abc.com & john.doe@xyz.com).

Anyone done this before?


  • TimL.58332 (Workflows)

    @Pratula.69048 (Customer)​ -- Here is something I made awhile back (In Okta Workflows) to check Okta for incremented name values. It doesn't find empty space but will return the next highest number.

     

    So for example won't find (3) in 1, 2, 4. Instead it will return the next highest increment of 5.

     

    Note: This is provided as-is. It's a demonstration of how one can leverage Workflows to perform this type of evaluation. Feel free to modify or incorporate none, some, or all of it.

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

    I've not done this but I do have Workflows for user onboarding that loops similar to what you do for FN.LN1, FN.LN2 etc. However only care if the full email has been used before. Since you need to tell if the same prefix for multiple suffixes/domains exists it would be nice if you could do a wildcard search for users like (filter=profile.email like "FN.LN@") but Okta's user search does not allow for wildcards in that way as far as I'm aware.

     

    If you have a defined set of suffixes/domains you could have Workflow that looped them looking for any matches and breaking the loop if it ever finds a match. If you don't have a defined list could you just do a search on the FirstName and LastName attributes assuming that they would never be duplicated since you are using them for the email prefix.

     

    Hope this helps and best of luck!

    Expand Post
    • Pratula.69048 (Customer)

      @Matthew Harshbarger (Customer)​ This is really helpful, thank you! I will try a few different things for the unique prefix across suffix's piece.

      Will you be able to share the Workflow for Fn.Ln looping for reference. TIA!

      • TimL.58332 (Workflows)

        @Pratula.69048 (Customer)​ -- Here is something I made awhile back (In Okta Workflows) to check Okta for incremented name values. It doesn't find empty space but will return the next highest number.

         

        So for example won't find (3) in 1, 2, 4. Instead it will return the next highest increment of 5.

         

        Note: This is provided as-is. It's a demonstration of how one can leverage Workflows to perform this type of evaluation. Feel free to modify or incorporate none, some, or all of it.

        Expand Post
        Selected as Best
      • Pratula.69048 (Customer)

        This was really helpful to understand the overall flow of the logic. Thank you!

This question is closed.
Loading
Generate and Validate unique email prefix across multiple suffix