Insert Multiple Records from same request-POST is not working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-22-2022 03:45 AM
In Import Set Table API, Insert Multiple Records from same request-POST is not working. Can anyone provide solution on how does that work?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2022 02:38 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2022 02:50 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2022 03:27 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2022 03:37 AM