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

Pass blank value in Salesforce connector

piyushm
Regular Contributor II
Regular Contributor II

Hello,

I am trying to pass '' in else condition with below logicfor an attribute in createaccountjson. With this, the condition in else is always satisfied even if the entitlement name is matching. That means the json does not accept blank value. I tried {} but the target doesn't accept null value.

Is there a way to not send this attribute if there is no matching entitlement?

 

"Attribute1": "${if(arsTasks.entitlement_valueKey.entitlement_value!=null && (arsTasks.entitlement_valueKey.entitlement_value == 'ev1' || arsTasks.entitlement_valueKey.entitlement_value =='ev2' || arsTasks.entitlement_valueKey.entitlement_value =='ev3' || arsTasks.entitlement_valueKey.entitlement_value =='ev4')) {'entid'} else {''}}

13 REPLIES 13

vivekmohanty_pm
Saviynt Employee
Saviynt Employee

@piyushm you can use this to completely remove the "Attribute1" key from the JSON using this - 

 

...
...
${if(arsTasks.entitlement_valueKey.entitlement_value!=null && (arsTasks.entitlement_valueKey.entitlement_value == 'ev1' || arsTasks.entitlement_valueKey.entitlement_value =='ev2' || arsTasks.entitlement_valueKey.entitlement_value =='ev3' || arsTasks.entitlement_valueKey.entitlement_value =='ev4')) {'"Attribute1": "entid",'} else {''}}
...
...

 

piyushm
Regular Contributor II
Regular Contributor II

Hi @vivekmohanty_pm , 

I tried with above syntax. But still it is going to the else condition even for the 4 entitlements.

vivekmohanty_pm
Saviynt Employee
Saviynt Employee

@piyushm can you share more details? maybe the logs where you are able to see this happening?

piyushm
Regular Contributor II
Regular Contributor II

@vivekmohanty_pm - I don't see anything printed in the logs about the attributes in the createaccountjson. I have {"showLogs":true} in the customconfigjson.

vivekmohanty_pm
Saviynt Employee
Saviynt Employee

@piyushm Can you tell me how you came to know that the flow is still going to the else condition even for the 4 entitlements? 

Are you able to see it in the logs? Or in the target application?

piyushm
Regular Contributor II
Regular Contributor II

I checked in target and the account is getting created with the entitlement but the attribute is not set. I also tried with dummy value in else condition like , else {'ABCDE'} and requesting one of the 4 entitlements. Then with this it works fine and sets the attribute with the value specified in the If condition.

vivekmohanty_pm
Saviynt Employee
Saviynt Employee

@piyushm will it be possible for you to share the debug logs and the full JSON you are using from a sandbox environment?

piyushm
Regular Contributor II
Regular Contributor II

Attached logs and json. The attribute is at the end of json.

vivekmohanty_pm
Saviynt Employee
Saviynt Employee

@piyushm Can you try with this create account JSON?

Regards,
Vivek Mohanty

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

piyushm
Regular Contributor II
Regular Contributor II

@vivekmohanty_pm - Tried with the json above. Still it is not setting the attribute.

piyushm
Regular Contributor II
Regular Contributor II

@vivekmohanty_pm - It is working with the new json that you shared. I was adding ',' after the 2nd last attribute thinking you missed it but looks like that is taken in this logic itself.

One last question. Does this also work for dynamic attribute? If a dynamic attribute is modified I don't want to pass profileid in the modifyaccountjson. The reason is as of now the update account task is getting executed last(even though there is a task execution hierarchy set, but its not working) and it overwrites the profileid being assigned from the Add Access task in the same request.

piyushm
Regular Contributor II
Regular Contributor II

@vivekmohanty_pm  Any thoughts or inputs on the previous question?

@piyushm Yes this should be possible for dynamic attributes too as long as you are able to translate the logic in a groovy script in the JSON.