Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Email generation rule for duplicate email.

aminahasware
New Contributor III
New Contributor III

Hi,

We have requirement that some users have multiple first names or last names (i.e., Lara-Rodriguez, Pyaram-Shashidhar, Cotto-Sediles, etc).

In this case, the email generation rule should be as follows-

  • If the first name or last name contains a hyphen (- ) then use it as it is.
  • If the first name or last name contains space ( ) then replace it with an underscore (_).
  • If a duplicate email is found, autoincrement it with 1 starting with number 2.

 

i.e. – if Marina_Cotto-Sediles@domain.com  is found

then the new mail ID will be Marina_Cotto-Sediles2@domain.com 

 

We have used advanced config and used below query.

 

CONCAT(
        REPLACE(REPLACE(users.firstname, ' ', '_'), '''', ''),
        '_',
        REPLACE(REPLACE(users.lastname, ' ', '_'), '''', ''),
        '@domain.com'
    )

This query is working as expected but the problem is if a duplicate email ID is found then how to auto-increment in advanced config?

[This message has been edited by moderator to disable email hyperlink]

3 REPLIES 3

rushikeshvartak
All-Star
All-Star

Refer https://forums.saviynt.com/t5/saviynt-knowledge-base/achieve-email-uniqueness-check-during-email-gen...

https://forums.saviynt.com/t5/saviynt-knowledge-base/how-to-escaping-special-characters-in-user-attr... 

 

CONCAT( REPLACE(REPLACE(users.firstname, ' ', '_'), '''', ''), '_', REPLACE(REPLACE(users.lastname, ' ', '_'), '''', ''), '@domain.com' )#CONCAT( REPLACE(REPLACE(users.firstname, ' ', '_'), '''', ''), '_', REPLACE(REPLACE(users.lastname, ' ', '_'), '''', ''), '1@domain.com' )#CONCAT( REPLACE(REPLACE(users.firstname, ' ', '_'), '''', ''), '_', REPLACE(REPLACE(users.lastname, ' ', '_'), '''', ''), '2@domain.com' )


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

yatishtiwari
Regular Contributor
Regular Contributor

Thank you, @rushikeshvartak . It worked.


Please click the 'Accept As Solution' button on the reply (or replies) that best answered your original question.


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.