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

Vinit556
New Contributor III
New Contributor III

Hello,

I have a requirement of generating unique email addresses. Here are the conditions:

1) For all the users first name and last is coming from HR data. Hence email should be:

   <firstname_lastname>@domain.com

    If user/email already exist, it should do auto increment.

2) For some of the users last name is coming as "." Hence email should be:

  <firstname>@domain.com

  If user/email already exist, it should do auto increment.

I have tried advance query, but it is not working

Any idea on it?

 

 

10 REPLIES 10

rushikeshvartak
All-Star
All-Star

Can you share query you tried


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

case when (users.lastname='.') then concat(users.firstname+1,'@dummy.com') else concat(users.firstname,'_',users.lastname+1,'@dummy.com') end

case when (users.lastname='.') then concat(users.firstname,'1@dummy.com') else concat(users.firstname,'_',users.lastname,'1@dummy.com') end

if doesn’t work share logs


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

Hello Rushikesh,
 
Increment is not working. first time email is created be last name as "." or not "." but thereafter email field is blank.
 
 
 
 
Here are the logs, where i tried first name as "test" and last name as "adam":
 
 
Vinit556_0-1665570374189.png

Vinit556_2-1665570423029.pngVinit556_4-1665570475167.png

 

You need to manually write increment logic . Email generation does not support ###INCREMENTAL### 

 


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

Thanks Rushikesh for the reply. 

I have tried everything but nothing seems to be working. 

Any help will be appreciated. 

Refer : https://forums.saviynt.com/t5/general-discussions/auto-increment-in-email-generation-rule-in-advance... 


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

Hello Rushikesh,

Now, I am using following query in Email generation rule (advance) to handle email creation manually

CASE WHEN (users.lastname like '%.%') THEN concat(users.firstname,'@domain.com') ELSE concat(users.firstname,'_',users.lastname,'@domain.com') END ###

CASE WHEN (users.lastname like '%.%') THEN concat(users.firstname,'1','@domain.com') ELSE concat(users.firstname,'_',users.lastname,'1','@domain.com') END ###

CASE WHEN (users.lastname like '%.%') THEN concat(users.firstname,'2','@domain.com') ELSE concat(users.firstname,'_',users.lastname,'2','@domain.com') END ###

CASE WHEN (users.lastname like '%.%') THEN concat(users.firstname,'3','@domain.com') ELSE concat(users.firstname,'_',users.lastname,'3','@domain.com') END

It works for users having different first and last name but if same first and last name is used it gives following error:

Vinit556_0-1665637671963.png

 

Vinit556
New Contributor III
New Contributor III

By changing END ### to END #  solved the prob

Yes separator for multiple  conditions is # not ### for email generation 


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