Click HERE to see how Saviynt Intelligence is transforming the industry. |
02/13/2024 01:03 PM
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.
Solved! Go to Solution.
02/13/2024 01:05 PM
You can use advanced configuration of account name rule
02/13/2024 01:08 PM
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
02/14/2024 01:51 AM
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.
02/14/2024 10:39 PM - edited 02/14/2024 10:45 PM
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)) ) ) ) )