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

Generate username generation rule with auto increment condition for duplicate entries.

RevatiTarale
New Contributor II
New Contributor II

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 

4 REPLIES 4

naveenss
All-Star
All-Star

Hi @RevatiTarale  did you try with the basic config like below having two rules?

 

naveenss_0-1709029987209.pngnaveenss_1-1709030017350.pngnaveenss_2-1709030047951.png

naveenss_3-1709030067659.png

 

Regards,
Naveen Sakleshpur
If this reply answered your question, please click the Accept As Solution button to help future users who may have a similar problem.

@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

 

Thanks for detailed info. Refer to the below forum

https://forums.saviynt.com/t5/identity-governance/username-generation-rule/m-p/40822

 

Regards,
Naveen Sakleshpur
If this reply answered your question, please click the Accept As Solution button to help future users who may have a similar problem.

Can you share logs


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.