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

Generating Unique Email ID in CheckForUnique parameter of ADSI connector

sdey_2023
Regular Contributor
Regular Contributor

Hi Team,

We have a requirement in which we need to generate unique email in the CheckForUnique Rule Check parameter of ADSI and we need to check for a few conditions before generating the email or appending the counter in case of duplicates found. We have referred the following forum posts ( How To - Achieve User / Account Name uniqueness ch... - Saviynt Forums - 28566 ) but unable to frame the syntax for checking conditions by using 'case when then' logic. 

The requirement is - if the user is of type employee and is having desiredfirstname present , then it will generate the email as desiredfirstname.lastname@domain.com, or else firstname.lastname@domain.com

Please let us know if the below syntax is correct:

{
"email": "customproperty3",
"RuleCheck": case when  (users.employeetype = "Employee" and users.preferedfirstname IS NOT NULL) then concat(lower(users.preferedfirstname),'.',lower(users.lastname),'@domain.com') end#case when  (users.employeetype = "Employee" and users.preferedfirstname IS NOT NULL) then concat(lower(users.preferedfirstname),'.',lower(users.lastname),1,'@domain.com') end

}

2 REPLIES 2

Darshanjain
Saviynt Employee
Saviynt Employee

Hi @sdey_2023 

You need to pass the condition in the json format ( the above is you are using sql format ), Use it same like a rest connector ( if else condition for ur requirement and try it out )

 

Thanks

Darshan

vivekmohanty_pm
Saviynt Employee
Saviynt Employee

@sdey_2023 Please try using this example for ADSI CHECKFORUNIQUE. Tweak this config according to your own logic. 

{
  "CheckForUnique": {
    "Attributes": {
      "email": "customproperty3",
      "RuleCheck": "${if(user.employeeType=='Employee' && user.preferedFirstName !=null){return user.preferedFirstName+'.'+user.lastname+'@domain.com'}}###${if(user.employeeType=='Employee' && user.preferedFirstName !=null){return user.preferedFirstName+'.'+user.lastname+'1@domain.com'}}###${if(user.employeeType=='Employee' && user.preferedFirstName !=null){return user.preferedFirstName+'.'+user.lastname+'2@domain.com'}}"
    }
  }
}