Username Generation Logic for Saviynt DB

sab2
Regular Contributor
Regular Contributor

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!

7 REPLIES 7

rushikeshvartak
All-Star
All-Star

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)))

sab2
Regular Contributor
Regular Contributor

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!!

Use single # instead of ###

sab2
Regular Contributor
Regular Contributor

Thank you.

That seems to give the same error as well, setting the username as ''ifemployeetype=Contractorleftlowerfirstname1"."lowerlastname".con"leftlowerfirstname1"."lowerlastname...'

Can you share query

sab2
Regular Contributor
Regular Contributor

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)))

 

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)