Click HERE to see how Saviynt Intelligence is transforming the industry. |
03/14/2024 04:59 AM
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
03/14/2024 06:09 AM
concat((substring(users.lastname,1,1),substring(users.firstname,1,2))###INCREMENTINDEX###
03/14/2024 10:05 AM
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