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

Skip an attribute in payload while provisioning

shreyascn18
New Contributor II
New Contributor II

Hello,

Can you please share an example on how to skip an attribute in REST connector create account JSON based on the dynamic attribute. 

If the Dynamic attribute value is 2099 then payload is 

{"UserLocation": [{"LocationId": "2099"}],
    "UserId": "Saviyntuser4@abc.com"}

Else in create account JSON we need to pass just 
    {"UserId": "Saviyntuser4@abc.com"}
7 REPLIES 7

PremMahadikar
Valued Contributor
Valued Contributor

rushikeshvartak
All-Star
All-Star

Please share full json you can use if else in this condition 

DB Connector Sample : { "CreateAccountQry": [ "${if(ACCOUNTTYPE.isEmpty()) { 'CREATE USER '+accountName+' FOR LOGIN ['+accountName+'] WITH DEFAULT_SCHEMA = ['+DEFAULT_DATABASE+'] ' } }" ] }


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

NM
Valued Contributor
Valued Contributor

Hi @shreyascn18 , Apply a check on DA if value ==2099 {payload

{"UserLocation": [{"LocationId""2099"}],
    "UserId""Saviyntuser4@abc.com"}
else payload
{"UserId": "Saviyntuser4@abc.com"}
 

shreyascn18
New Contributor II
New Contributor II

Hello @rushikeshvartak @NM 

Getting an error with start date, if not the if else condition works with Dynamic attribute

{
"dateFormat": "yyyy-MM-dd'T'HH:mm:ss",
"accountIdPath": "call1.message.data.UserId",
"call": [
{
"name": "call1",
"connection": "acctAuth",
"url": "https://xxxx",
"httpMethod": "POST",
"httpParams": "${requestAccessAttributes.PrimaryOrgId ==('4099')?'{\"Address\":{\"FirstName\":\"'+user.firstname+'\",\"LastName\":\"'+user.lastname+'\"},\"IsActive\":true,\"StartDate\":\"'+ if (user.startdate!=null) {Calendar today=Calendar.getInstance();today.setTime(user.startdate);today.getTime().format(\"yyyy-MM-dd'T'HH:mm:ss'Z'\")} else ''+'\",\"UserId\":\"'+user.email+'\",\"UserLocation\":[{\"LocationId\": \"4099\"}]}':'{\"Address\":{\"FirstName\":\"'+user.firstname+'\",\"LastName\":\"'+user.lastname+'\"},\"IsActive\":true,\"StartDate\":\"'+if (user.startdate!=null) {Calendar today=Calendar.getInstance();today.setTime(user.startdate);today.getTime().format(\"yyyy-MM-dd'T'HH:mm:ss'Z'\")} else ''+'\",\"UserId\":\"'+user.email+'\"}'}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201,
204,
205
]
}
}
]
}

NM
Valued Contributor
Valued Contributor

Hi @shreyascn18 , are you trying to pass user startdate if yes .. i believe you can directly use the user.startdate instead of using calendar.getinstance

shreyascn18
New Contributor II
New Contributor II

Hello @NM 

No that wont work, because there is a particular format required which is in yyyy-MM-dd'T'HH:mm:ss. so using user.startdate wont print it in that format.

NM
Valued Contributor
Valued Contributor

@shreyascn18 , try this

user.enddate.format('yyyy-MM-dd'T'HH:mm:ss.SSZ')