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

Samaccount name Generation

akumar98
New Contributor
New Contributor

Hello everyone,

I want to create the systemgeneration logic using advanced query-

first character of lastname, first 2 characters of firstname,Random number(0-9) and any serial number

It should take only digit number(0-9), no characters and if its is duplicate, it should auto-increment.

Thanks

2 REPLIES 2

Raghu
All-Star
All-Star

concat((substring(users.lastname,1,1),substring(users.firstname,1,2))###INCREMENTINDEX###


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

PremMahadikar
All-Star
All-Star

Hi @akumar98 ,

Try below code,

CONCAT(SUBSTRING(lastname,1,1),SUBSTRING(firstname,1,2),SUBSTRING((FLOOR(RAND() * (9-2 + 1)) + 2),1,1))###
CONCAT(SUBSTRING(lastname,1,1),SUBSTRING(firstname,1,2),SUBSTRING((FLOOR(RAND() * (9-2 + 1)) + 2),1,1),FN_EIC_SEQGEN('samincrement'))

Note: Define dataset (samincrement) at Identity Repository -> Dataset. Use this documentation for reference - Database Functions

One more suggestion, in the request you want to add random digit to the systemusername. I think, having random in the code and then incrementing in the same code is not possible in the advanced config. However, please try the above code. If this doesn't work - please use pre-processor to generate systemusername logic. Link for documentation on preprocessor and best practice.

 

If this answers your question, please consider Accepting As Solution and hit Kudos