and more in a single search tool across platforms. Read the announcement here. |
10/12/2022 01:33 AM
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/12/2022 02:45 AM
Can you share query you tried
10/12/2022 02:49 AM
case when (users.lastname='.') then concat(users.firstname+1,'@dummy.com') else concat(users.firstname,'_',users.lastname+1,'@dummy.com') end
10/12/2022 02:53 AM
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
10/12/2022 03:25 AM
10/12/2022 05:16 AM
You need to manually write increment logic . Email generation does not support ###INCREMENTAL###
10/12/2022 06:30 AM
Thanks Rushikesh for the reply.
I have tried everything but nothing seems to be working.
Any help will be appreciated.
10/12/2022 09:07 AM
10/12/2022 10:16 PM
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:
10/12/2022 11:00 PM
By changing END ### to END # solved the prob
10/13/2022 01:27 AM
Yes separator for multiple conditions is # not ### for email generation