Can we send multiple records to Service Now within a single REST request?

Kaushik Muley1
Giga Contributor

As per the requirement, the third party tool is supposed to send multiple records in a single REST request.
Can Service Now import set API consume the multiple record JSON to create/update records on target table?

If yes, what should be the format of JSON string?

As per the initial analysis, I found the wiki article on JSONv2, but it does not seem to be working with REST request.

1 ACCEPTED SOLUTION

Yes, a scripted REST API is going to be a better way to go in this case (over a processor). The biggest advantage is that you can use versioning so one app can continue to use v1 (perhaps with no URI parameters) while another app can use v2 (with two URI parameters) simultaneously. Processors cannot do that. You need to maintain two separate processors which can be cumbersome. There are other advantages as well.



Scripted REST APIs


Check Episode 23 here: TechNow Episode List  


View solution in original post

10 REPLIES 10

ramireddy
Mega Guru

Yes, I suppose multiple record insert is not supported. Below wiki link mentioned that.


Table API - ServiceNow Wiki



Thanks


Rami Reddy


Yes. But I am using Import set API.
Would it make any difference?


Chuck Tomasi
Tera Patron

Have you tried a JSON array as the payload?



[{'name':'Chuck'}, {'name':'Dave'}, {'name':'Sherri'}]



Try building something like that using the REST API Explorer to test.



ServiceNow Developers


REST API Explorer - ServiceNow Wiki


I tried to use the request body as below in the REST API explorer.



[{'impact':'1','short_description':'Test'},{'impact':'2','short_description':'Testing'}]



This created only first record on incident form. It does not seem to be accepting this format.



Would the scripted REST APIs be useful in this scenario?