Load data using JSON file

Vinayak10
Kilo Guru

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

8 REPLIES 8

Prasant Kumar 1
Kilo Sage

Hi ,

Follow the below links , it might help you.

https://docs.servicenow.com/bundle/orlando-platform-administration/page/administer/import-sets/refer...

 

If i was able to solve your query please mark my answer correct and helpful.

Thanks & Regards

Prasant kumar sahu

Saud1
Mega Guru

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"
    }]
}

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Vinayak,

Sample example below; this worked for me;

Data Source:

find_real_file.png

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

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hello Sir,

For me Path for each row field is not available, I am facing same issue

find_real_file.png