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

If else condition in RemoveAccountJSON

sukoor
New Contributor
New Contributor

Hi Team,

There is requirement to pass comments in RemoveAccountJSON to target system

1. Pass comment as 'StaleDueToInactivity' if account is removed due to stale functionality

2.Pass comment as 'LeaverDueToInactivity' if account is removed due to Leaver functionality

But we are able to pass only one comment.Please check below code and let us know if there 'if else' condition can be used in below JSON and pass comments as per the functionality in RemoveAccountJSON

{
"call": [{
"name": "call1",
"connection": "acctAuth",
"url": "https://maersk--sit.my.salesforce.com/services/data/v57.0/sobjects/User/${account.accountID}",
"httpMethod": "PATCH",
"httpParams": "{\"IsActive\": false,\"Notes__c\": \"StaleDueToInactivity\"}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201,
204
]
}
}]
}

2 REPLIES 2

SB
Saviynt Employee
Saviynt Employee

Is there an attribute that will be used to identify how the account is getting removed. Thsi will be needed to construct if-else condition.

You can use Java operations to tweak any attributes by using if-else conditions, substrings, or operators in the JSON for provisioning. Below is an example you can refer to and construct your condition accordingly.

"Username": "${if(((user.departmentNumber!=account.customproperty23.substring(3,5)) && (user.customproperty30==account.customproperty27))||((user.departmentNumber==account.customproperty23.substring(3,5)) && (user.customproperty30!=account.customproperty27))){user.email+'.everest'} else if(((user.departmentNumber!=account.customproperty23.substring(3,5)) && (user.customproperty30!=account.customproperty27))|| user.customproperty3!=account.customproperty31||user.customproperty9=='Terminated'|| user.customproperty21=='ASAP'){user.email+'.everest'+'_'+Calendar.getInstance().getTime().format('yyyyMMdd')} else {user.email+'.everest'}}"


Regards,
Sahil

sukoor
New Contributor
New Contributor

Thanks Sahil