Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

Username Generation Rule syntax compared to System Username Generation

elvarg
New Contributor
New Contributor

I have a question regarding the syntax/proccessing that happens differently for username/system username Rule Generation when using the advanced sql query for building the logic.

Background: Want to generate Username ID's with a prefix based on company and their own counter to keep it as immutable as possible.


For example the following code will work in Systemusername Rule generation advanced query but when in username generation it will insert the whole logic as "username"

 

case when (users.companyname = 'ACME') then concat('ACMA',lpad((FN_EIC_SEQGEN('UACME')),5,'0')) when (users.companyname ='Contoso') then concat('CON',lpad((FN_EIC_SEQGEN('UCON')),5,'0')) else concat('Unkown',lpad((FN_EIC_SEQGEN('Unkown')),4,'0')) end

 

 but if wrap the logic in a concat() then it will work fine for username logic and generate correctly. have not tried the reverse and wrap the systemusername rule in concat()

 

concat(case when (users.companyname = 'ACME') then concat('ACMA',lpad((FN_EIC_SEQGEN('UACME')),5,'0')) when (users.companyname ='Contoso') then concat('CON',lpad((FN_EIC_SEQGEN('UCON')),5,'0')) else concat('Unkown',lpad((FN_EIC_SEQGEN('Unkown')),4,'0')) end)

 

Do not know if it is documented anywhere that you have to wrap the username logic? since it is now needed for the system username. I do not know if this is a bug in the Lab environment where currently testing some logic. Or this this is the expected Behaviour hence asking the question.

 

PS changed the FN_EIC_SEQGEN reference between systemusername and username rule, so unclear on its behaviour if it will give 2 different values in the generation (as it should since it should go +1 for each call to the function).

3 REPLIES 3

NM
Esteemed Contributor
Esteemed Contributor

Instead of concat just try select case once for username @elvarg 


If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'

elvarg
New Contributor
New Contributor

It has to same impact as concat() the question is why is this not required for systemusername. why do they have different syntax.

  • Can you share logs and current output along with expected output with sample example.
  • Also how users are created ? UI /Import 

Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.