Load data using JSON file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2020 09:34 PM
Hi All,
I am trying to load using JSON file as attachment but getting error's. i have followed below steps let me know if i am wrong at any stpes.
1. Created data source with Type: File, Format: JSON and File retrieval method: Attachement.
2. added import set table which is extended by Import Set Row .
3. Attached simpe JSON (created json file with .json) having data as below.
{
"source":"HI",
"incidents":"Test"
}
getting below error while clicking Load all Records/Test load 20 records.
Error: com.glide.db.impex.datasource.DataSourceException: org.jaxen.XPathSyntaxException: Unexpected ''
Any lead thanx in Advance.
Thanks and Regards,
Vinayak
- Labels:
-
Scripting and Coding
-
Team Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2020 10:17 PM
Hi ,
Follow the below links , it might help you.
If i was able to solve your query please mark my answer correct and helpful.
Thanks & Regards
Prasant kumar sahu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2020 10:17 PM
Hello Vinayak,
I believe that the incidents property should be an array of incidents to be created. Change the JSON to this and try it:
{
"source": "HI",
"incidents": [{
"short_description": "Test"
}]
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2020 10:48 PM
Hi Vinayak,
Sample example below; this worked for me;
Data Source:
create file with name as whatever; the file extension can be txt; below is the file content I used
{
"incidents": [
{
"short_description": "hello",
"comments": "test"
},
{
"short_description": "hello1",
"comments": "test1"
}
]
}
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2022 01:41 AM