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 condition in Rest CreateAccount JSON

RizvanaShaik
New Contributor
New Contributor

Hi Team,

while creating an account for application we are using Createaccount JSON as follows where we want the sid attribute to be populated if and only if the account name starts with 'S'

however , it is not working please specify if am missing anything syntax wise 

below is the create account JSON 

{
"accountIdPath": "accountName",
"dateFormat": "yyyy-MM-dd'T'HH:mm:ssXXX",
"call": [
{
"name": "call1",
"connection": "acctAuth",
"showResponse": false,
"url": "<URL here>/v2/users",
"httpMethod": "POST",
"httpParams": "{ \"eid\": \"${user.username}\", \"sid\": \"${arsTasks.accountName like 's%'?arsTasks.accountName:'null'||''}}\", \"name\":\"${user.firstname+' '+user.lastname}\",\"firstName\": \"${user.firstname}\", \"lastName\":\"${user.lastname}\", \"email\": \"${user.email}\",\"active\": \"true\",\"role\":\"View Only\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
201,
200
]
},
"unsuccessResponses": {
"statusCode": [
400,
401,
403,
404
]
}
}
]
}

 

Thanks,

Rizvana

1 REPLY 1

rushikeshvartak
All-Star
All-Star

{
"accountIdPath": "accountName",
"dateFormat": "yyyy-MM-dd'T'HH:mm:ssXXX",
"call": [
{
"name": "call1",
"connection": "acctAuth",
"showResponse": false,
"url": "<URL here>/v2/users",
"httpMethod": "POST",
"httpParams": "{ \"eid\": \"${user.username}\", \"sid\": \"${arsTasks.accountName?starts_with('S')?arsTasks.accountName:''}\", \"name\":\"${user.firstname + ' ' + user.lastname}\",\"firstName\": \"${user.firstname}\", \"lastName\":\"${user.lastname}\", \"email\": \"${user.email}\",\"active\": \"true\",\"role\":\"View Only\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
201,
200
]
},
"unsuccessResponses": {
"statusCode": [
400,
401,
403,
404
]
}
}
]
}


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