Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Issue in storing expected inbound JSON Payload coming from an external third party application

Bhuvanesh1
Kilo Explorer

When trying to receive the Inbound payload from an external third-party application, I have used 'System Web Services->Inbound' to receive the payload. In that inbound web service, I have handled transform mapping and sent the data to a custom import set row table I created. I couldn't get the expected JSON format as I am getting an array of object in the request payload.

Inbound payload:

{

"u_sendtype":"7",

"u_itemtypename":"Incident",

"u_vendorname":"XYZ",

"u_saveasynchronously":"true",

"u_fields":

[

{

"u_sys_id":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx24",

"u_correlation_display":"sdfbn",

"u_correlation_id":"kjsdfn",

"u_caller_id":"fsahdfkjadsj",

"u_assignment_group":"DESK",

"u_opened":"2022-02-10T10:08:08",

"u_short_description":"Password Reset",

"u_description":"\n Ben needs a password reset for active directory\n",

"u_business_service":"",

"u_category":"network",

"u_subcategory":"password reset - domain",

"u_contact_type":"Phone",

"u_impact":3,

"u_urgency":2,

"u_priority":3,

"u_company":"XYZ Corp",

"u_state": 6,

"u_hold_reason":1,

"u_close_notes":"Closed",

"u_close_code":"Solved",

"u_location":"New York",

"u_phone":"",

"u_parent_id":"",

"u_change_request_field":"",

 

"u_comments":7,

"u_work_notes":"worknotes"

}

]

}

 

Here is the screenshot of JSON payload that is getting stored in the import set row table in an unexpected format.

NOTE:

  1. Double quotes is missing
  2. Key "=" Value format is found

find_real_file.png

 Expected format that I need:

find_real_file.png

 Could anyone please provide some solution for this?

 Thanks in advance!

 

Regards,

Bhuvanesh

3 REPLIES 3

ersureshbe
Giga Sage
Giga Sage

Hi,

If you are using import set table to retrieve the data from external application then OOB will change it to required format.

Why you want to change it to you requested format. Please make my understanding clearly.

Regards,

Suresh.

Regards,
Suresh.

Hi suresh,

From third party I am receiving the JSON payload in the array format, when I tried to save the zeroth array in an import set table field it is saved in the unexpected format I have mentioned above.

Regards,

Bhuvanesh

Sukraj Raikhraj
Kilo Sage

possible not setting the right format type? use JSON stringify function.