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

Conditional Call in REST API AddAccessJSON

aksharkay
New Contributor III
New Contributor III

Hi all,

Is there a way to skip an API call inside the AddAccessJSON of a REST connector, based on a condition? In our use case, we don't want the API in that call to be triggered at all if a particular condition fails. We also don't want the AddAccessTask to fail while trying to skip this call.

I was exploring the "callCondition" attribute but as per the documentation, it is only available in the CreateAccountJSON. I was hoping to use a similar option in the AddAccessJSON.

Any guidance on this topic would be greatly appreciated!

Thanks & Regards,

Akshar

7 REPLIES 7

AmitM
Valued Contributor
Valued Contributor

Hi Akshar,

Can't you do something to not create the task instead creating and then trying to skip.

If not possible, you can have if else / ternary operator to use two urls. The SKIP url could be anything like health check etc..

Same in http params , 

Thanks,

Amit

If this answers your query, Please ACCEPT SOLUTION and give KUDOS.

rushikeshvartak
All-Star
All-Star

callCondition Works in all jsons

 "callCondition": "${arstasksObj?.source == 'WEBSERVICE'}",

i have used above in rest connector and azure ad connector in v24.2


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

Hi Rushikesh, thank you for your response.

We had used "callCondition": "${entitlementValuesObj.entitlement_value == 'Entitlement Value'}" in our AddAccessJSON (Saviynt version 23.10), but this call did not get triggered and there was no error message either. Kindly let me know if the above condition seems fine to you.

AmitM
Valued Contributor
Valued Contributor

As per Saviynt doc , callCondition only supported for "CreateAccountJSON".

callCondition

Use this attribute in the following scenarios:

  • If a provisioning parameter includes multiple calls, each call is invoked only if the condition provided in this attribute is true. Otherwise, the call is skipped.

  • If the response of a call contains a list, the call iterates into the list.

Note

This attribute is supported only for the CreateAccountJSON parameter.

It works in all JSONs 


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

 "callCondition": "${arstasksObj?.entitlementValueKey.entitlement_Value== 'ABCD'}",


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

NM
Regular Contributor III
Regular Contributor III

Hi @aksharkay, you can also try something like this.

"connection": "${if(user.customproperty2 == 'Test'){'acctAuth'}else {''}}"