Announcing the SAVIYNT KNOWLEDGE EXCHANGE unifying the Saviynt forums, documentation, training, and more in a single search tool across platforms. Click HERE to read the Announcement.

JSON error when updating the Phone number to workday

KB99
New Contributor
New Contributor

When trying to use the following JSON in UPDATEUSERJSON of the Workday SOAP getting the JSON validation error

Here is my JSON to update the Phone number

[{"REQUESTXML": "${'<env:Envelope xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"><env:Header><wsse:Security env:mustUnderstand=\"1\"><wsse:UsernameToken><wsse:Username>'+USERNAME+'</wsse:Username><wsse:Password Type=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText\">'+PASSWORD+'</wsse:Password></wsse:UsernameToken></wsse:Security></env:Header><env:Body><wd:Maintain_Contact_Information_for_Person_Event_Request xmlns:wd=\"urn:com.workday/bsvc\" wd:Add_Only=\"true\" wd:version=\"v39.0\"><wd:Business_Process_Parameters><wd:Auto_Complete>true</wd:Auto_Complete><wd:Run_Now>true</wd:Run_Now></wd:Business_Process_Parameters><wd:Maintain_Contact_Information_Data><wd:Worker_Reference><wd:ID wd:type=\"Employee_ID\">'+user?.employeeid+'</wd:ID></wd:Worker_Reference><wd:Worker_Contact_Information_Data>"${user.customproperty26 != null && user.customproperty26 != ''?'<wd:Phone_Data wd:Delete=\"false\" wd:Do_Not_Replace_All=\"true\"><wd:International_Phone_Code>'+user?.customproperty25+'</wd:International_Phone_Code><wd:Phone_Number>'+user?.customproperty26+'</wd:Phone_Number><wd:Phone_Device_Type_Reference><wd:ID wd:type=\"Phone_Device_Type_ID\">Landline</wd:ID></wd:Phone_Device_Type_Reference><wd:Usage_Data wd:Public=\"true\"><wd:Type_Data wd:Primary=\"true\"><wd:Type_Reference><wd:ID wd:type=\"Communication_Usage_Type_ID\">Work</wd:ID></wd:Type_Reference></wd:Type_Data></wd:Usage_Data></wd:Phone_Data>':''}""${user.customproperty31 != null && user.customproperty31 != ''?'<wd:Phone_Data wd:Delete=\"false\" wd:Do_Not_Replace_All=\"true\"><wd:International_Phone_Code>'+user?.customproperty30+'</wd:International_Phone_Code><wd:Phone_Number>'+user?.customproperty31'</wd:Phone_Number><wd:Phone_Device_Type_Reference><wd:ID wd:type=\"Phone_Device_Type_ID\">Mobile</wd:ID></wd:Phone_Device_Type_Reference><wd:Usage_Data wd:Public=\"true\">"${user.customproperty26 != null && user.customproperty26 != ''?'<wd:Type_Data wd:Primary=\"false\">':'<wd:Type_Data wd:Primary=\"true\">'}"'<wd:Type_Reference><wd:ID wd:type=\"Communication_Usage_Type_ID\">Work</wd:ID></wd:Type_Reference></wd:Type_Data></wd:Usage_Data></wd:Phone_Data>':''}""${user.customproperty31 != null && user.customproperty31 != ''?'<wd:Phone_Data wd:Delete=\"false\" wd:Do_Not_Replace_All=\"true\"><wd:International_Phone_Code>'+user?.customproperty28+'</wd:International_Phone_Code><wd:Phone_Number>'+user?.customproperty29'</wd:Phone_Number><wd:Phone_Device_Type_Reference><wd:ID wd:type=\"Phone_Device_Type_ID\">Fax</wd:ID></wd:Phone_Device_Type_Reference><wd:Usage_Data wd:Public=\"true\">"${(user.customproperty26 != null && user.customproperty26 != '') || (user.customproperty26 != null && user.customproperty26 != '')?'<wd:Type_Data wd:Primary=\"false\">':'<wd:Type_Data wd:Primary=\"true\">'}"'<wd:Type_Reference><wd:ID wd:type=\"Communication_Usage_Type_ID\">Work</wd:ID></wd:Type_Reference></wd:Type_Data></wd:Usage_Data></wd:Phone_Data>':''}"'</wd:Worker_Contact_Information_Data></wd:Maintain_Contact_Information_Data></wd:Maintain_Contact_Information_for_Person_Event_Request></env:Body></env:Envelope>'}" }]

2 REPLIES 2

pruthvi_t
Saviynt Employee
Saviynt Employee

Hi @KB99 , Can you please try to validate the JSON and see if there are any syntax errors. Also please try to run the JSON in the SOAP UI for the workday instance connection you're using and see if you're seeing the same UI there as well.


Regards,
Pruthvi

KB99
New Contributor
New Contributor

Hi Pruthvi 

I have first if condition and there is another condition where  i am checking on other property after that 

I highlighted the area where i am seeing the issue and want to know if that is the correct syntax

 

"${user.customproperty26 != null && user.customproperty26 != ''?'<wd:Phone_Data wd:Delete=\"false\" wd:Do_Not_Replace_All=\"true\"><wd:International_Phone_Code>'+user?.customproperty25+'</wd:International_Phone_Code><wd:Phone_Number>'+user?.customproperty26+'</wd:Phone_Number><wd:Phone_Device_Type_Reference><wd:ID wd:type=\"Phone_Device_Type_ID\">Landline</wd:ID></wd:Phone_Device_Type_Reference><wd:Usage_Data wd:Public=\"true\"><wd:Type_Data wd:Primary=\"true\"><wd:Type_Reference><wd:ID wd:type=\"Communication_Usage_Type_ID\">Work</wd:ID></wd:Type_Reference></wd:Type_Data></wd:Usage_Data></wd:Phone_Data>':''}""${user.customproperty31 != null && user.customproperty31 != ''?'<wd:Phone_Data wd:Delete=\"false\" wd:Do_Not_Replace_All=\"true\"><wd:International_Phone_Code>'+user?.customproperty30+'</wd:International_Phone_Code><wd:Phone_Number>'+user?.customproperty31'</wd:Phone_Number><wd:Phone_Device_Type_Reference><wd:ID wd:type=\"Phone_Device_Type_ID\">Mobile</wd:ID></wd:Phone_Device_Type_Reference><wd:Usage_Data wd:Public=\"true\">"${user.customproperty26 != null && user.customproperty26 != ''?'<wd:Type_Data wd:Primary=\"false\">':'<wd:Type_Data wd:Primary=\"true\">'}"'<wd:Type_Reference><wd:ID wd:type=\"Communication_Usage_Type_ID\">Work</wd:ID></wd:Type_Reference></wd:Type_Data></wd:Usage_Data></wd:Phone_Data>':''}"