Insert Multiple Records from same request-POST is not working.

Devishree Anant
Tera Contributor

In Import Set Table API, Insert Multiple Records from same request-POST is not working. Can anyone provide solution on how does that work?

4 REPLIES 4

Tony Chatfield1
Kilo Patron

Hi, I just tested this in a rome instance via API explorer and it worked as expected.

Perhaps you could provide specific details of your configuration, payload and the response that you are receiving from your POST message, so that the forum can better understand your issue.

Please refer to the attached screenshot:

find_real_file.png

In the import set table api, I am mapping two fields Caller and Description.

I am getting 400 Bad Request as response: 

find_real_file.png

Please do provide a solution for this.

Thanks.

Hi, low resolution partial screenshots are never an appropriate way to share details of an issue, but I can just make out your payload in the first screenshot and it is not valid.

As you are populating multiple records (even if it's just 1 record) you must encapsulate your data in a 'records' array so that it is read\understood as multiple 'records'

https://developer.servicenow.com/dev.do#!/reference/api/rome/rest/c_ImportSetAPI#import-POST-insertMultiple

{
   "records":[
      {
         "<ColumnLabel1>":"<value>",
         "<ColumnLabel2>":"<value>"
      },
      {
         "<ColumnLabel1>":"<value>",
         "<ColumnLabel2>":"<value>"
      }
   ]
}

 

Try constructing your request body in the 'raw' tab of the REST API explorer.

Thanks, it is working:

find_real_file.png