How to perform batch insert operation for my custom servicenow table.

Rohan18
Kilo Contributor

I was trying to perform batch insert operation for my custom table using Curl. Accoring to ServiceNow doc therir is possibility using "Table API" and "job Schedule".but still not getting exact solution.  

1 ACCEPTED SOLUTION

Can't you just loop the curl command for each record then?

Or do you want to POST multiple records at once? In this case, it's possible for ServiceNow to receive JSON data and have Scripted REST API. The problem would be timeout if simple Scripted API is used with many records.

https://docs.servicenow.com/bundle/helsinki-application-development/page/integrate/custom-web-servic...

View solution in original post

10 REPLIES 10

Hitoshi Ozawa
Giga Sage
Giga Sage

Not curl but it's possbile to setup a schedule in ServiceNow to do import.

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

Thanks for the suggestion hozawa.

Ben Carlsten -
Giga Guru

Hello,

You can access your tables through REST if you do a couple things:

  1. Make sure the table has 'Allow access to this table via web services' checked in the Application Access tab (screenshot below)
  2. Send a POST call to the table using credentials of a user with proper access controls (if you use a user with 'admin' that'll be alright for sure).  You can get the structure of the call and code actually by looking at the REST API Explorer (search that in the navigator).  Use 'now', 'Table API', latest, and choose the table you want.  It'll give you curl commands on the bottom as well as a couple others.

find_real_file.png

find_real_file.png

Hope this helps,

Ben

Hi Ben Carlsten,

Thanks for the explanation,Its really help me.

Now I able to perfrom insert operation through "curl".Does it possible to insert multiple records using single "curl" using this approach.Do you have any idea about this?