and more in a single search tool across platforms. Read the announcement here. |
02/27/2024 01:23 AM
Hello team,
I am working to set up an auto-increment condition for the username generation rule.
Requirement
We have requirements were.
1. I want to create a username for the user with the format firstname_lastname@abc.com.
2. If another entry of the user comes with the same name it should reflect with firstname_lastname1@abc.com.
I have achieved the first condition with the below query:
concat(SUBSTRING_INDEX(users.firstname, ' ', 1), '_', SUBSTRING_INDEX(users.lastname, ' ', 1) '@abc.com') ### CASE WHEN (users.firstname IS NOT NULL) THEN concat(SUBSTRING_INDEX(users.firstname, ' ', 1), '_', SUBSTRING_INDEX(users.lastname, ' ', 1), '@abc.com') END
For the second condition (avoid duplicates) we tried to give the below query but not getting result:
concat(SUBSTRING_INDEX(users.firstname, ' ', 1), '_',(SUBSTRING_INDEX(users.lastname, ' ', 1), '@abc.com') ### CASE WHEN (users.firstname IS NOT NULL) THEN concat(SUBSTRING_INDEX(users.firstname, ' ', 1), '_',(SUBSTRING_INDEX(users.lastname, ' ', 1), '@abc.com') END ### concat(SUBSTRING_INDEX(users.firstname, '.',1,1) , '_',(SUBSTRING_INDEX(users.lastname, '1',1,1), '@abc.com')### concat(SUBSTRING_INDEX(users.firstname, '.',1,1) , '_',(SUBSTRING_INDEX(users.lastname, '2',1,1), '@abc.com') ### concat(SUBSTRING_INDEX(users.firstname, '.',1,1) , '_',(SUBSTRING_INDEX(users.lastname, '3',1,1), '@abc.com') END
Please guide what are the required steps need to follow for second requirement. Also how to generate username with duplicate entries in the expected format.
Thanks
Revati
02/27/2024 02:35 AM
Hi @RevatiTarale did you try with the basic config like below having two rules?
02/27/2024 03:06 AM - edited 02/27/2024 03:08 AM
@naveenss Yes, tried this one, and gives a successful result. But in my case, there is a condition of the client that says if the user has the first name: Kristine Peri then it should take only Kristine to create the username. They have most of the users with first names and last names like this.
I tried but failed to achieve this condition with basic rules. To achieve this, I gave a query in advance configuration.
(SUBSTRING_INDEX(users.firstname, ' ', 1)
Please let me know if we can achieve a similar case of username with an auto-increment condition.
Thanks
Revati
02/27/2024 03:36 AM
Thanks for detailed info. Refer to the below forum
https://forums.saviynt.com/t5/identity-governance/username-generation-rule/m-p/40822
02/27/2024 08:34 PM
Can you share logs