Using Nested Response in JSON
If the data is in the root of the JSON then the entire key is specified. However, if the data in the response is nested within another JSON or array, then a tilde ‘~’ symbol is used to denote the path to the data to be mapped.
- Nested JSON response from ServiceNow referenced in AppViewX
{
"result": [
{
"u_glide_date_1": "",
"parent": "",
"reason": "",
"u_start_date": "2016-11-21 07:58:35",
"u_end_date": "2016-11-23 07:58:35",
"backout_plan": "",
"u_approval": " Approved",
"upon_reject": "cancel",
"sys_updated_on": "2016-11-11 07:58:35",
"type": "Comprehensive",
"conflict_status": "Not Run",
"approval_history": "",
"u_number": "CHG0030682",
"test_plan": "",
"sys_updated_by": "admin",
"opened_by": {
"link": "https://ven01189.service-now.com/api/now/table/sys_user/6816f79cc0a8016401c5a33be04be441",
"value": "6816f79cc0a8016401c5a33be04be441"
}]
}
- Mapping response from ServiceNow into AppViewX using tilde ’~’
{
"ServiceNowConfig": {
"serviceName": "ServiceNow",
"serviceApiList": {
"getTicket": {
"url": "/api/now/table/u_vip_create?sysparm_query=u_number=<ticketNumber>",
"responseDataMapping": {
"state": "result~u_approval",
"startTime": "result~u_start_date",
"endTime": "result~u_end_date",
"sysId": "result~sys_id",
"ticketNumber": "result~u_number"
},
"apiListToCallAfter": [
"getDeviceList"