How to parse complex response body in schedule job
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2024 06:03 AM
Response body from third party tool to ServiceNow:
{
"database": {
"allSheets": {
"facts": [
{
"cluster": {
"name": "Oracle",
"description": "This is used by db team.",
"Type": "database",
"Hosting": "Saas",
"life": {
"state": "Operational"
},
"rel1": {
"totalCount": 4,
"edges": [
{
"node": {
"Sheet": {
"name1": "problem",
"description": null
}
}
},
{
"node": {
"Sheet": {
"name1": "incident,
"description": null
}
}
},
{
"node": {
"Sheet": {
"name1": "Supply chain" ,
"description": null
}
}
},
{
"node": {
"Sheet": {
"name1": "inovation",
"description": null
}
}
}
]
},
"Owner": {
"totalCount": 2,
"edges": [
{
"node": {
"user": {
"userName": "abc@gmail.com"
},
"type": "OBSERVER",
"roles": [
{
"name": "Architect"
}
]
}
},
{
"node": {
"user": {
"userName": "xyz@gmail.com"
},
"otype": "RESPONSIBLE",
"roles": [
{
"name": "Developer"
}
]
}
}
]
}
}
},
{
"cluster": {
"name": "Adobe",
"description": "Adobe.",
"Type": "database",
"Hosting": "Saas",
"life": {
"state": "Operational"
},
"subscriptions": {
"totalCount": 0,
"edges": []
}
}
},
above response to be parsed and each record to be added in ServiceNow Custom table
Field | Value |
name | Oracle |
description | This is used by db team. |
Type | database |
Hosting | Saas |
life | Operational |
rel1 | problem |
incident | |
Owner | xyz@gmail.com |
otype | RESPONSIBLE |
work | Developer |
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2024 11:15 PM
Hi @s r1 ,
Can you please explain the complete setup here? Have you setup a REST data source? or do you want to handle this response in scheduled script execution?
Regards,
Pranav Thanedar