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

Account Name Generation using CP

prasadpatil16
New Contributor III
New Contributor III

Hello Experts,

I have SAP application integrated with Saviynt and need to generate the unique account name. 

Below are the conditions

1. Name John Lunar

I_LUNARJ

2. User with same name John Lunar joins (As per the format I_LUNARJ it should validate and create as below)

I_LUNARJO

3. User with same name John Lunar joins(As per the format I_LUNARJO it should validate and create as below)

I_LUNARJOH

The account name can be only with 12 characters.

Can someone help me with building query for the same.

4 REPLIES 4

rushikeshvartak
All-Star
All-Star

You can use advanced configuration of account name rule


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

CASE WHEN LENGTH(CONCAT('I_',users.lastname, LEFT(users.firstname, 1))) > 12 THEN CONCAT('I_', SUBSTRING(users.lastname, 1, 7), LEFT(users.firstname, 1), '_1') ELSE CONCAT('I_', users.lastname, LEFT(users.firstname, 1)) END


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

prasadpatil16
New Contributor III
New Contributor III

Hello Rushikesh,

Thanks for the assistance. 

But your query does this for 3 condition. What if there 5 users in same name. 

Also want to understand how will we check the duplicate account name.

 

Its saviynt check internally and goes to next account name rule

 IF(LENGTH(CONCAT('I_',users.lastname, LEFT(users.firstname, 1))) > 12, CONCAT('I_', SUBSTRING(users.lastname, 1, 7), LEFT(users.firstname, 1), '_1'), IF(LENGTH(CONCAT('I_',users.lastname, LEFT(users.firstname, 1))) > 10, CONCAT('I_', SUBSTRING(users.lastname, 1, 7), LEFT(users.firstname, 1), '_2'), IF(LENGTH(CONCAT('I_',users.lastname, LEFT(users.firstname, 1))) > 8, CONCAT('I_', SUBSTRING(users.lastname, 1, 7), LEFT(users.firstname, 1), '_3'), IF(LENGTH(CONCAT('I_',users.lastname, LEFT(users.firstname, 1))) > 6, CONCAT('I_', SUBSTRING(users.lastname, 1, 7), LEFT(users.firstname, 1), '_4'), CONCAT('I_', users.lastname, LEFT(users.firstname, 1)) ) ) ) )

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