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

If else in REST JSON updateAccount

Rajatlm10
New Contributor III
New Contributor III

Hi, we need to if else in the REST connector JSON. 

for a patch call if operation = add we need to send different payload and for operation = remove we need to send different payload. 

 

{
"call": [
{
"name": "Country",
"connection": "acctAuth",
"url": "https:/xyz/Users/${account.customproperty5}",
"httpMethod": "PATCH",
"httpParams": "{\"schemas\":[\"urn:ietf:params:scim:api:messages:2.0:PatchOp\"],\"Operations\":[{\"op\": \"add\",\"path\":\"urn:ietf:params:scim:schemas:extension:spend:2.0:Role:roles\",\"value\":[{\"roleName\":\"${requestAccessAttributes.get('Role')}\",\"roleGroups\":[\"${arsTasks.entitlement_valueKey.customproperty1}\"]}]}]}",
}

above JSON in case of when operation op=Add, and in case of op=remove we only need to pass the entitlement i.e. requestAccessAttributes.get('Role'). 

I am not getting the right syntax to be used for this . Can anyone help me on this ?

 

5 REPLIES 5

rushikeshvartak
All-Star
All-Star

{
"call": [
{
"name": "Country",
"connection": "acctAuth",
"url": "https:/xyz/Users/${account.customproperty5}",
"httpMethod": "PATCH",
"httpParams": "{\"schemas\":[\"urn:ietf:params:scim:api:messages:2.0:PatchOp\"],\"Operations\":[{\"op\":\"${operationType}\",\"path\":\"urn:ietf:params:scim:schemas:extension:spend:2.0:Role:roles\",\"value\":[{\"roleName\":\"${requestAccessAttributes.get('Role')}\",\"roleGroups\":[\"${arsTasks.entitlement_valueKey.customproperty1}\"]}]}]}"
}
]
}


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Rajatlm10
New Contributor III
New Contributor III

@rushikeshvartak 

 

I am Not able to understand your solution here. Can you please help me on this ?

How do you decide operations it should be based on dynamic attributes I considered operationtype as dynamic attribute


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Yes, its a dynamic attribute having values Add and remove as values in dropdown. 

In that case above should if not working share logs


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.