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 Failed using Advance Config

rohanpandit
New Contributor II
New Contributor II

Hi,

We are using Advance config for email Generation but it is not working as expected. Below are the requirement from customer and the query which is not working.

1. Default Email Address.

FirstName.LastName@domain.com

2. If there is a match between first and last name of a new employee with an existing one, middle name can be used.

E.g. FirstName.x.lastname@domain.com

First Name - Employee's First Name

x- First initial of Employee's Middle Name

Last Name- Employee's Last Name

3. In a rare case where there would still be a duplication, the full middle name can be added.

E.g. firstname.middlename.lastname@domain.com

First Name - Employee's First Name

Middle Name- Employee's Middle Name

Last Name- Employee's Last Name

4. In case, middle name not available the a number will be added starting from 1 and goes on.

E.g. firstname.lastname1@domain.com

firstname.lastname2@domain.com

First Name - Employee's First Name

Last Name- Employee's Last Name

Below is the query used and it is not working.

concat(users.customproperty27, '.', users.customproperty28, substring('dev@cynergybank.co.uk',1,21)) END # case when (users.middlename is NOT NULL) THEN concat(users.customproperty27, '.', substring(users.middlename,1,1), '.', users.customproperty28, substring('dev@cynergybank.co.uk',1,21)) END # case when (users.middlename is NOT NULL) THEN concat(users.customproperty27, '.', users.middlename, '.', users.customproperty28, substring('dev@cynergybank.co.uk',1,21)) END # concat(users.customproperty27, '.', users.customproperty28, substring('1dev@cynergybank.co.uk',1,22))

4 REPLIES 4

sudeshjaiswal
Saviynt Employee
Saviynt Employee

Hello @rohanpandit,

You may try the below query for the above use case,

concat(users.customproperty27, substring('.',1,1), users.customproperty28, substring('dev@cynergybank.co.uk',1,21)) ###
CASE
WHEN (
    users.middlename IS NOT NULL
  )
  THEN
  concat(users.customproperty27, substring('.',1,1), substring(users.middlename,1,1), substring('.',1,1), users.customproperty28, substring('dev@cynergybank.co.uk',1,21))
END
###
CASE
WHEN (
    users.middlename IS NOT NULL
  )
  THEN
  concat(users.customproperty27, substring('.',1,1), users.middlename, substring('.',1,1), users.customproperty28, substring('dev@cynergybank.co.uk',1,21))
END
### concat(users.customproperty27, substring('.',1,1), users.customproperty28, substring('1dev@cynergybank.co.uk',1,22))


Thanks,

If you find the above response useful, Kindly Mark it as "Accept As Solution".

Hi Team,

It is still not working. Only 1st case is working, rest all the cases are failing.

 

Also, there is one more use case, Middle name will be used only when there is a match between first and last name of a new employee. 

If middle name exist, but there is no match between first and last name of a new employee then middle name will not be used.

How we can set a condition if email ID is unique and user middle name exists, middle name should not be used?

sudeshjaiswal
Saviynt Employee
Saviynt Employee

Hello @rohanpandit

You can choose to retain and test it with just the 2nd and 3rd conditions, or with the 1st and 2nd conditions initially, to see if it works. This approach will make it easier to identify the point at which it fails.
Additionally, I suggest reviewing the logs as they can provide valuable information to pinpoint the exact location of the issue.

Sample:-
---------------------------XX--------------------------------
CASE
WHEN users.middlename IS NOT NULL THEN
concat(users.customproperty27, '.', substring(users.middlename,1,1), '.', users.customproperty28, 'dev@cynergybank.co.uk')
ELSE
concat(users.customproperty27, '.', users.customproperty28, 'dev@cynergybank.co.uk')
END

---------------------------XX--------------------------------

Thanks,

If you find the above response useful, Kindly Mark it as "Accept As Solution".