Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

Checking uniqueness of the systemusername with account names

Shrinita
New Contributor
New Contributor

I have generated systemusername using below query in global configuration.

IF(
firstname IS NOT NULL AND firstname != '' AND
lastname IS NOT NULL AND lastname != '',
UPPER(
CONCAT(
SUBSTRING(firstname, 1, 1),
IFNULL(NULLIF(SUBSTRING(middlename, 1, 1), ''), 'X'),
SUBSTRING(lastname, 1, 1),
RPAD(FLOOR(RAND() * 1000), 3, '0')
)
),
NULL
)

Now I want to check the uniqueness of the systemusername with the account names and hence I have tried the below query for the same but not able to get expected output. 
IF(IF(
firstname IS NOT NULL AND firstname != '' AND
lastname IS NOT NULL AND lastname != '',
UPPER(
CONCAT(
SUBSTRING(firstname, 1, 1),
IFNULL(NULLIF(SUBSTRING(middlename, 1, 1), ''), 'X'),
SUBSTRING(lastname, 1, 1),
RPAD(FLOOR(RAND() * 1000), 3, '0')
)
),
NULL
)) EXISTS IN ACCOUNTS.NAME


2 REPLIES 2

Raghu
All-Star
All-Star

@Shrinita  Here account name condition not a scope, once generate the new user accountname/system usernmae will create based on your logic,  still you want compare those you can map endpoint level account co-relation rule based on you requiremnt it work.

 


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

Shrinita
New Contributor
New Contributor

Could you please give me an example how it works with respect to our scenario?