Click HERE to see how Saviynt Intelligence is transforming the industry. |
02/22/2024 04:05 AM
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
Solved! Go to Solution.
02/22/2024 05:02 AM
Hi @sxm1067 ,
Refer to the below forum post
02/22/2024 08:13 AM
Hi,
I tried to implement the solution but it is not working as expected -
Below is the create user form populated with this config -
Please let me know If I miss anything.
Regards,
Sujata
02/22/2024 08:36 PM
Does Refresh mentioned on Preferred Display name DA
02/22/2024 10:22 PM
Yes, Refresh mentioned on extpreferredFirstname.
02/22/2024 10:30 PM
Can you check logs when you input fn & ln
02/22/2024 10:40 PM
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
Regards,
Sujata
02/22/2024 10:44 PM
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.
Query: select 'Yes' as ID union select 'No' as ID
Validation Condition: ${generateusername.equals('Yes')}
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:
02/23/2024 09:04 PM
Hi,
This solution works, thanks for the help.
Regards,
Sujata