Click HERE to see how Saviynt Intelligence is transforming the industry. |
09/30/2024 02:04 AM - edited 09/30/2024 02:04 AM
Dear Saviynt Community,
I am currently working on a use case in which I need to generate a system username based on a comparison with the account name. I have successfully implemented the following condition to generate a username when the first name, middle name, and last name are provided:
IF(
firstname IS NOT NULL AND firstname != '' AND
lastname IS NOT NULL AND lastname != '',
UPPER(
CONCAT(
SUBSTRING(firstname, 1, 1),
IFNULL(NULLIF(SUBSTRING(middlename, 1, 1), ''), 'X'),
SUBSTRING(lastname, 1, 1),
LPAD(FLOOR(RAND() * 1000), 3, '0')
)
),
NULL
)
I am now looking to enhance this logic by adding a condition to also check the account name before generating the username.
Could someone please guide me on how I can incorporate the account name validation into the current logic, or if there’s an alternative approach I should consider?
Thank you in advance for your support and guidance.
Best regards,
Goutam Ahirwar
Solved! Go to Solution.
09/30/2024 02:23 AM
@GoutamAhirwar check below
IF(
firstname IS NOT NULL AND firstname != '' AND
lastname IS NOT NULL AND lastname != '' AND
accountname IS NOT NULL AND accountname != '',
UPPER(
CONCAT(
SUBSTRING(firstname, 1, 1),
IFNULL(NULLIF(SUBSTRING(middlename, 1, 1), ''), 'X'),
SUBSTRING(lastname, 1, 1),
LPAD(FLOOR(RAND() * 1000), 3, '0')
)
),
NULL
)
09/30/2024 02:37 AM
No brother not working not genreating systemusername
09/30/2024 02:41 AM
Does below solution worked?
09/30/2024 03:42 AM
No
09/30/2024 04:01 AM
Do systemusername generation logic from global configurations supports account table comparison ?
09/30/2024 02:53 AM
your query working before adding account condition ?
09/30/2024 03:40 AM - edited 09/30/2024 03:42 AM
it was working before adding after adding its not working for account checking
09/30/2024 03:54 AM
@GoutamAhirwar check below column is modified
IF(
firstname IS NOT NULL AND firstname != '' AND
lastname IS NOT NULL AND lastname != '' AND
systemusername IS NOT NULL AND systemusername != '',
UPPER(
CONCAT(
SUBSTRING(firstname, 1, 1),
IFNULL(NULLIF(SUBSTRING(middlename, 1, 1), ''), 'X'),
SUBSTRING(lastname, 1, 1),
LPAD(FLOOR(RAND() * 1000), 3, '0')
)
),
NULL
)
09/30/2024 04:01 AM
it didn't work please let me know .Do systemusername generation logic from global configurations supports account table comparison ?