We are delighted to share our new EIC Delivery Methodology for efficiently managing Saviynt Implementations and delivering quick time to value. CLICK HERE.

Condition call for disablement account based on call1 response

navneetv
Regular Contributor II
Regular Contributor II

Hi Team,

Need your help. We have a use case, where we want to disable the user based on a filter. if the user doesn't have that filter's value then check the other filter's value 

We have a total of 6 types of approval. each user has approval could be two or more. Example 

 

John  has below approval limit

{
"requisition-approval-limit": {
"amount": 0,
"currency": {
"code": "USD"
}

Mariya has two approval limit
},
"expense-approval-limit": {
"amount": 0,
"currency": {
"code": "USD"
}
},
"invoice-approval-limit": {
"amount": 0,
"currency": {
"code": "USD"
}

}

so if we pass all 6 approval limits in in single body. it updated to the user's account. Like now if pass below the body with PUT call it. add those approval limits that John doesn't have 

navneetv_0-1701334600129.png

So we want to pass the body based on the approval limit. If John has "requisition-approval-limit" then in the request body only "requisition-approval-limit" should be passed not all 5 types of approval 

{
"accountIdPath": "call1.message.id",
"responseColsToPropsMap": {},
"call": [
{
"name": "call1",
"connection": "acctAuth",
"url": "<URL>api/users/${account.accountID}",
"httpMethod": "GET",
"httpParams": "",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json"
},
{
"name": "call2",
"connection": "${response.call1.message.requisition-approval-limit == 'requisition-approval-limit'?'acctAuth':''}",
"url": "<URL>/api/users/${account.accountID}",
"httpMethod": "PUT",
"httpParams": "{\"active\":false,\"roles\":null,\"requisition-approval-limit.amount\":0}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200
]
}
},
{
"name": "call3",
"connection": "${response.call1.message.expense-approval-limit == 'expense-approval-limit'?'acctAuth':''}",
"url": "<URL>/api/users/${account.accountID}",
"httpMethod": "PUT",
"httpParams": "{\"active\":false,\"roles\":null,\"expense-approval-limit.amount\":0}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200
]
}
},
{
"name": "call4",
"connection": "${response.call1.message.invoice-approval-limit == 'invoice-approval-limit'?'acctAuth':''}",
"url": "<URL>/api/users/${account.accountID}",
"httpMethod": "PUT",
"httpParams": "{\"active\":false,\"roles\":null,\"invoice-approval-limit.amount\":0}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200
]
}
},
{
"name": "call5",
"connection": "${response.call1.message.requisition-self-approval-limit == 'requisition-self-approval-limit'?'acctAuth':''}",
"url": "<URL>/api/users/${account.accountID}",
"httpMethod": "PUT",
"httpParams": "{\"active\":false,\"roles\":null,\"requisition-self-approval-limit.amount\":0}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200
]
}
},
{
"name": "call6",
"connection": "${response.call1.message.expense-self-approval-limit == 'expense-self-approval-limit'?'acctAuth':''}",
"url": "<URL>/api/users/${account.accountID}",
"httpMethod": "PUT",
"httpParams": "{\"active\":false,\"roles\":null,\"expense-self-approval-limit.amount\":0}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200
]
}
},
{
"name": "call7",
"connection": "${response.call1.message.invoice-self-approval-limit == 'invoice-self-approval-limit'?'acctAuth':''}",
"url": "<URL>/api/users/${account.accountID}",
"httpMethod": "PUT",
"httpParams": "{\"active\":false,\"roles\":null,\"invoice-self-approval-limit.amount\":0}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200
]
}
}
]
}

could you please help or suggest here, how to achieve this by using conditions based on the response 

2 REPLIES 2

Dhruv_Sharma
Saviynt Employee
Saviynt Employee

Hi @navneetv 

For this scenario, could you please try the condition in httpParams instead of connection and use if-else to compare those values. Currently you are using the comparison in condition as below.

"connection": "${response.call1.message.expense-self-approval-limit == 'expense-self-approval-limit'?'acctAuth':''}",

Please refer to the link to a post below for sample syntax.

Solved: If-else condition in REST connection - Saviynt Forums - 2943

Regards,

Dhruv Sharma

navneetv
Regular Contributor II
Regular Contributor II

Hi @Dhruv_Sharma  in Single body how we can pass all approval limit by using if else as some user has two approval some have all so we are not sure which user has how many approval limits. 

could you please help me to use the IF-else condition? so that if one or two approval limits get in response then in remove body Json only two approval limits pass not others?