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

From your explanation, do you want to kick a job on ServiceNow to pull the data to import or to POST each data using curl?

Or are you thinking of scheduling in ServiceNow to kick a curl script to either of the above 2 optiions?

Rohan18
Kilo Contributor

Basically I m trying to fetch data from my custom reporting tool(Third party API) which gives me the details like name,email etc. in responce.

Now I would like to insert all the respoonce into ServiceNow’s table for that I already created one custome table for this and able to perform single record insert opertaion using 'CURL'.

so trying hard to implement multiple record insert functionality for the same instied of single record insert at each time.

  

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...

hi hozawa,

Thanks for the help, Its work fine for me .

as per your second thought "The problem would be timeout if simple Scripted API is used with many records."  what was it? is their any limit for record ?

 In additionally I just wanted to mention the reference video for those who are stuck with the same issue. 

 

I was updating a record based on REST call result. It was working fine during the test with few records but when the number of records increases, it began to timeout because it was taking more time. It's possible to increase the timeout limit but I found it was also hurting performance on my instance.

I ended up breaking the REST call to page records instead of doing it all in one go.

Timeout limit is depends on size of the REST message and time required to process the message so it's not just about the number of records. It's necessary to test and find the best record size.