Data source type REST : how to give jpath_rooth node for the following response data
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2022 03:44 PM
Hi Community,
I have created Data source with type REST and created the REST action with necessary inputs.
i am getting data in JSON format and when i click load test data i dont see any record in my staging table. I figured there is something wrong with my path for each row field in the Data source. i tried giving /data/data this throws error saying expected '.".?/.
Data according to the post man and REST message is in below format
{
"data": [
[
{
"columnName": "Employee Number",
"dataType": "xs:string",
"maxLength": "20",
"value": "001235"
},
{
"columnName": "Employment Status",
"dataType": "xs:string",
"maxLength": "2002",
"value": "Active"
},
{
"columnName": "Full/Part Time Code",
"dataType": "xs:string",
"maxLength": "4",
"value": "F"
},
{
"columnName": "Salary Or Hourly Code",
"dataType": "xs:string",
"maxLength": "4",
"value": "H"
},
{
"columnName": "Employee Name (Last Suffix, First MI)",
"dataType": "xs:string",
"maxLength": "2414",
"value": "randy, oden."
},​
Here is the path that i gave
Error that i received with above path.
Can any one suggest me how to give this "path for Each row" in order for that to parse data on to the staging stable (import set) ?
Thank you.
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2022 06:46 PM
Hi
as you can read on page https://docs.servicenow.com/bundle/rome-platform-administration/page/administer/import-sets/referenc...:
For JSON arrays, the path for each row must specify the array root element twice, such as /incidents/incidents
.
As in your JSON structure you have 2 nested arrays, I assume the correct path must be
/data/data/data/data
Kind regards
Maik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2022 07:44 AM
I tried with /data/data/data/data. it giving error saying no fields for mapping to headers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2022 11:04 AM
OK is as able to get data by /data/data/* or data/data/data. But the data is getting stored as rows instead of Columns with column name . Can you suggest me how can i get it right.