Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Create User form - Populating an attribute value by concatenating the other dynamic attribute values

sxm1067
New Contributor III
New Contributor III

Hi,

I have a use case where I need to concatenate the values from 2 fields on the create user request form and populate it in a 3rd field.


There are 3 fields (dynamic attributes) - "extfirstName", "extlastName" & "extpreferredFirstname". These are of type String and the requestor can type any value in these fields.


There is a 3rd field - "extdisplayName" whose value should be the concatenation of the values entered in extfirstName, extpreferredFirstname & extlastName.

If user enters extpreferredFirstname then extdisplayName should be extpreferredFirstname+extlastName.

And If user don't enter the extpreferredFirstname then extdisplayName should be extfirstName+extlastName.

I have tried the below approache but it is not working:

select concat(${if(binding.variables.containsKey('extpreferredFirstname')) {extpreferredFirstname} else {firstname}},' ',${if(binding.variables.containsKey('extmiddleName')) {extmiddleName} else {' '}},${if(binding.variables.containsKey('extlastName'} {extlastName} else {''}} ) as ID

 

Can anyone identify what the issue might be with the above mentioned approach? Also, is there some other setting that needs to be configured while establishing such a relationship between dynamic attributes?

 

Thanks,

Sujata

8 REPLIES 8

naveenss
All-Star
All-Star

Hi @sxm1067 ,

Refer to the below forum post

https://forums.saviynt.com/t5/identity-governance/create-user-form-populating-an-attribute-value-by-...

 

Regards,
Naveen Sakleshpur
If this reply answered your question, please click the Accept As Solution button to help future users who may have a similar problem.

sxm1067
New Contributor III
New Contributor III

Hi,

I tried to implement the solution but it is not working as expected -

sxm1067_0-1708618163585.pngsxm1067_1-1708618183423.pngsxm1067_2-1708618248166.pngsxm1067_3-1708618264248.pngsxm1067_4-1708618287625.pngsxm1067_5-1708618304223.png

Below is the create user form populated with this config -

sxm1067_6-1708618376815.png

Please let me know If I miss anything.

Regards,

Sujata

Does Refresh mentioned on Preferred Display name DA 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

sxm1067
New Contributor III
New Contributor III

Yes, Refresh mentioned on extpreferredFirstname.

sxm1067_0-1708669322152.pngsxm1067_1-1708669340830.png

 

Can you check logs when you input fn & ln


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

sxm1067
New Contributor III
New Contributor III

Hi Rushikesh,

In the logs I can see the concat query is not fetching the dynamic attributes (firstname and lastname) -

select concat(${extfirstName},${extlastName}) as ID

sxm1067_0-1708670415932.png

Regards,

Sujata

Refer https://forums.saviynt.com/t5/saviynt-knowledge-base/configuring-create-register-user-form-in-eic/ta...

Define a dynamic attribute to calculate username on basis of first and last name of the user:

We can use a SQL type of dynamic attribute to access the string given as input for first and last name of the user. Since we need to trigger an update in the username dynamic attribute to calculate the value of the username, we need an extra attribute which will trigger a refresh action on the username dynamic attribute. Please find below the example on how to achieve this.

Sample dynamic attributes which are used to calculate username
  1. Define two string type of dynamic attributes to take inputs for first and last name

rushikeshvartak_0-1708670626713.png

 

 

rushikeshvartak_1-1708670626663.png

 

 

 

rushikeshvartak_2-1708670626712.png

 

 

 

rushikeshvartak_3-1708670626703.png

 

 

 

 

  1. Define another attribute to drive the refresh of the username dynamic attribute – This could be of type Single Select SQL with values as Yes and No

rushikeshvartak_4-1708670626693.png

 

 

rushikeshvartak_5-1708670626792.png

 

 

rushikeshvartak_6-1708670626674.png

 

Query: select 'Yes' as ID union select 'No' as ID

Validation Condition: ${generateusername.equals('Yes')}

  1. Define a dynamic attribute of type SQL single select to generate username

rushikeshvartak_7-1708670626675.png

 

 

rushikeshvartak_8-1708670626762.png

 

 

rushikeshvartak_9-1708670626782.png

 

 

 

Query: SELECT lower(concat(${firstname},'.',${lastname}, if(count(username)=0,'',convert(count(username),UNSIGNED)))) as ID FROM users WHERE username like concat(${firstname},'.',${lastname},'%') HAVING ID IS NOT NULL and 'Yes'=${generateusername} and ${firstname}!='' and ${lastname}!='' and ${createformtype} != 'Visitor' union all select ${emailaddress} as ID from dual HAVING ID IS NOT NULL and 'Yes'=${generateusername} and ${createformtype} = 'Visitor' and ${emailaddress} != '' LIMIT 1;

 

Notes:

  1. ${firstname}, ${lastname}, ${createformtype}, ${emailaddress}, ${generateusername} are all various dynamic attributes in the user creation form

Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Hi,

This solution works, thanks for the help.

Regards,

Sujata