01/18/2023 06:56 PM
Hi Everyone,
We are looking for a sample function to use to generate a users username through the Saviynt database.
For our use case, we have multiple different username logics we need to use. We are hoping to use the advanced query under the username generation to call the query on the Saviynt database where we will place the username logic.
Does anyone have a sample function to input into the advanced logic to call this?
Thanks in advance!
01/18/2023 07:12 PM
if(users.employeetype='Contractor',concat(left(lower(users.firstname),1),".",lower(users.lastname),".con"),concat(left(lower(users.firstname),1),".",lower(users.lastname)))###if(users.employeetype='Contractor',concat(left(lower(users.firstname),2),".",lower(users.lastname),".con"),concat(left(lower(users.firstname),2),".",lower(users.lastname)))###if(users.employeetype='Contractor',concat(left(lower(users.firstname),3),".",lower(users.lastname),".con"),concat(left(lower(users.firstname),3),".",lower(users.lastname)))
01/19/2023 08:45 PM
Thank you Rushikesh. When I tried this, but it sets the username as 'ifemployeetype=Contractorleftlowerfirstname1"."lowerlastname".con"leftlowerfirstname1"."lowerlastname...' am I missing something?
Also, this post was a bit more towards if there was any sample function to call for the username generation logic that is stored on the Saviynt database? And we use the username advanced query to call it?
Thank you!!
01/19/2023 08:52 PM
Use single # instead of ###
01/20/2023 06:39 AM
Thank you.
That seems to give the same error as well, setting the username as ''ifemployeetype=Contractorleftlowerfirstname1"."lowerlastname".con"leftlowerfirstname1"."lowerlastname...'
01/20/2023 12:15 PM
Can you share query
01/24/2023 10:19 AM
Yes,
if(users.employeetype='Contractor',concat(left(lower(users.firstname),1),".",lower(users.lastname),".con"),concat(left(lower(users.firstname),1),".",lower(users.lastname)))#if(users.employeetype='Contractor',concat(left(lower(users.firstname),2),".",lower(users.lastname),".con"),concat(left(lower(users.firstname),2),".",lower(users.lastname)))#if(users.employeetype='Contractor',concat(left(lower(users.firstname),3),".",lower(users.lastname),".con"),concat(left(lower(users.firstname),3),".",lower(users.lastname)))
01/24/2023 12:48 PM
try this sample
concat(users.firstname , substring('.',1,1) , users.lastname) ### CASE WHEN (users.middlename is NOT NULL) THEN concat(users.firstname , substring('.',1,1) , substring(users.middlename,1,1) , substring('.',1,1) , users.lastname) END ### concat(users.firstname , substring('.',1,1) , users.lastname , substring('1',1,1))### concat(users.firstname , substring('.',1,1) , users.lastname , substring('2',1,1))### concat(users.firstname , substring('.',1,1) , users.lastname , substring('3',1,1)