doubt regarding JSON structure for calling an API

0
Caused by: com.mendix.modules.microflowengine.MicroflowException: Error calling REST service at InsightsHub_API.MF_Put_Values (CallRest : 'Call REST (PUT)') at TicketManagement.TicketNP_Create (SubMicroflow : 'MF_Put_Values') at TicketManagement.TicketNP_Create_Malfunction (SubMicroflow : 'TicketNP_Create') at TicketManagement.MF_Call_Check (SubMicroflow : 'TicketNP_Create_Malfunction')   Advanced stacktrace: at com.mendix.integration.actions.microflow.RestCallAction.execute(RestCallAction.scala:79)   Caused by: com.mendix.modules.microflowengine.MicroflowException: Failed to evaluate expression, error occurred on line 6, character 18 '{ "Description": "' + $TicketNP/Description + '", "ShortDescription": "' + $TicketNP/ShortDescription + '", "TicketID": ' + $TicketNP/TicketID + ', "CallerPhoneNumber": "' + $TicketNP/CallerPhoneNumber + '", DueDate: ' + formatDateTime($TicketNP/DueDate, 'yyyy-MM-dd')+'T'+formatDateTime($TicketNP/DueDate,'HH:mm:ss.SSSZ') + ', ^ "CallerName": "' + $TicketNP/CallerName + '", _time: ' + formatDateTime($TicketNP/DueDate, 'yyyy-MM-dd')+'T'+formatDateTime($TicketNP/DueDate,'HH:mm:ss.SSSZ') + ', }'     at InsightsHub_API.MF_Put_Values (CallRest : 'Call REST (PUT)') at TicketManagement.TicketNP_Create (SubMicroflow : 'MF_Put_Values') at TicketManagement.TicketNP_Create_Malfunction (SubMicroflow : 'TicketNP_Create') at TicketManagement.MF_Call_Check (SubMicroflow : 'TicketNP_Create_Malfunction')       When I try to call a microflow that creates a new entry in my Insights Hub(Mindsphere) database, this is the error that is shown. It shows there is an issue in evaluating the DueDate format. Can anyone tell me the root cause of the issue and how to solve.
asked
2 answers
0

Hi Aditya,

could you check via debugger if $TicketNP/DueDate attribute is coming as empty or not

answered
0

Hi Aditya,

I think error in json structure of Due date attribute. try this 

"DueDate": "' + formatDateTime($TicketNP/DueDate, 'yyyy-MM-dd') + 'T' + formatDateTime($TicketNP/DueDate, 'HH:mm:ss.SSSZ') + '",

answered