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

successfactos Writeback nothing if the value is null from updateuserJSON

sppnra
Regular Contributor
Regular Contributor

Hi Saviynt team,

i need to update the API where if the phonenumber value is null in saviynt it shouldn't writeback anything right now in Successfactor its writing as null

 

{
"name": "Update Login",
"connection": "userAuth",
"url": "https:///odata/v2/upsert?$format=json",
"httpMethod": "POST",
"httpParams": "[{\"__metadata\":{\"uri\":\"PerPhone(phoneType='4817',personIdExternal='${user.username}')\"},\"phoneType\":\"4817\",\"phoneNumber\":\"${user?.phonenumber}\",\"isPrimary\":false}]",
"httpHeaders": {
"Authorization": "${access_token}",
"X-HTTP-METHOD": "MERGE",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": 200
}
}

7 REPLIES 7

SumathiSomala
All-Star
All-Star

@sppnra Seems url has additional backslash /

"url": "https:///odata/v2/upsert?$format=json",

Regards,
Sumathi Somala
If this reply answered your question, please Accept As Solution and give Kudos.

sppnra
Regular Contributor
Regular Contributor

Hi @SumathiSomala ,

I have removed the company URL for confidentiality 

@Dhruv_S  

Dhruv_S
Saviynt Employee
Saviynt Employee

Hi @sppnra ,

I am not sure whether it will work but can you once try with the below.

${(user?.phonenumber != null)? user.phonenumber :''} in place of {user?.phonenumber}

Regards,

Dhruv Sharma

sppnra
Regular Contributor
Regular Contributor

Hi @Dhruv_S ,

I used your suggestion but still it's sending null value

"httpParams": "[{\"__metadata\":{\"uri\":\"PerPhone(phoneType='4783',personIdExternal='${user.username}')\"},\"phoneType\":\"4783\",\"phoneNumber\":\"${(user?.phonenumber != null) ? user.phonenumber: ''}\",\"isPrimary\":false}]",

sppnra_0-1699614844606.png

 

 

Dhruv_S
Saviynt Employee
Saviynt Employee

Hi @sppnra 

Need to check if null value is supported by API. 

Meanwhile could you please try below 

${if(user?.phonenumber?.isNull()){''} else {user.phonenumber}}

Regards,

Dhruv Sharma

sppnra
Regular Contributor
Regular Contributor

hi @Dhruv_S  

I have tested this. It's not working.

thanks,

Rahul

Dhruv_S
Saviynt Employee
Saviynt Employee

Hi @sppnra 

Could you please try to call the similar API from postman and check if you are able to update blank in SuccessFactors. If blank is not supported by the success factor, then Saviynt will not be able to update too.

Regards,

Dhruv Sharma