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

Issue with Null value in Dynamic Attribute for Salesforce

soumyabrata
New Contributor III
New Contributor III

Hi Team,

We have couple of Dynamic Attribute fields in ARS for for Salesforce of type String where user may or may not provide any information as a string as it not mandatory.

If there some value it works fine but if it blank or empty it gives error:

"2024-03-25T20:25:41.399+00:00","ecm-worker","provisoning.SalesForceProvisioningService","quartzScheduler_Worker-6-rsv2l","DEBUG","*** Error in creating user = No such property: attributeValue for class: com.saviynt.provisoning.SalesForceProvisioningService"
"2024-03-25T20:25:41.399+00:00","ecm-worker","println.PrintlnToLogger","quartzScheduler_Worker-6-rsv2l","DEBUG","Println :: | Error groovy.lang.MissingPropertyException: No such property: attributeValue for class: com.saviynt.provisoning.SalesForceProvisioningService"
"2024-03-25T20:25:41.399+00:00","ecm-worker","println.PrintlnToLogger","quartzScheduler_Worker-6-rsv2l","DEBUG","Println :: | Error  at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:50)"

I tried below statements but not working:

"Manager_1__c": "${((requestAccessAttributes.Manager1==null)||(requestAccessAttributes.Manager1?.equals('')))? null:(requestAccessAttributes.Manager1)}"

"Manager_1__c": "${if(requestAccessAttributes.Manager1==null || requestAccessAttributes.Manager1 == '' ) {''} else {requestAccessAttributes.Manager1}}"

"Manager_1__c": "${if(requestAccessAttributes?.Manager1!=null){user.Manager1} else{''}}"

Can anyone help here any other way to handle if no value provided in DA field?

5 REPLIES 5

rushikeshvartak
All-Star
All-Star

"Manager_1__c": "${(requestAccessAttributes.Manager1 == null || requestAccessAttributes.Manager1.trim() == '') ? '' : requestAccessAttributes.Manager1}"


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

Tried

"Manager_1__c": "${(requestAccessAttributes.Manager1 == null || requestAccessAttributes.Manager1.trim() == '') ? '' : requestAccessAttributes.Manager1}"

But getting same error:

"2024-03-25T22:34:39.745+00:00","ecm-worker","provisoning.SalesForceProvisioningService","quartzScheduler_Worker-3-rsv2l","DEBUG","Key = null and Value=92"
"2024-03-25T22:34:39.745+00:00","ecm-worker","provisoning.SalesForceProvisioningService","quartzScheduler_Worker-3-rsv2l","DEBUG","*** Error in creating user = No such property: attributeValue for class: com.saviynt.provisoning.SalesForceProvisioningService"

"Manager_1__c": "${(requestAccessAttributes?.Manager1 == null || requestAccessAttributes?.Manager1.trim() == '') ? '' : requestAccessAttributes?.Manager1}"


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

soumyabrata
New Contributor III
New Contributor III

I tried but no luck.

I used default value as 'NA' and then used below to pass '' if value is 'NA' and it seems working for now.

"Manager_1__c": "${if(requestAccessAttributes.Manager1=='NA') {''} else {requestAccessAttributes.Manager1}}"

Issue is when Manager1 Attribute not field then its not available under requestAccessAttributes hence go with default value and keep it mandatory 


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