write a script to create a record in scripted rest api

Rakshanda Kunte
Tera Contributor

Hi All,

 

I need to write a script to create a record on existing table in SN.

 

Can anyone please suggest the format to write a script?

 

 

 

Thanks..

3 REPLIES 3

Kieran Anson
Kilo Patron

Have you looked at using the Table API, or Import Set API? Are you restricted based on the inbound payload format?

More details would be needed to provide a suitable solution 

Hi @Kieran Anson ,

 

 

I am new to implement integration request. Looking for solution which will not impact prod.

 

Below is the requirement:

Users in the Splunk team have a table in ServiceNow that shows Splunk indexes (existing custom table)  and their ownership.

 

This table is static and has to be manually updated when splunk team create new indexes.
they would like it to be dynamically updated from Splunk, most feasible solution is via REST API.

 

 

The import set API can do this. https://developer.servicenow.com/dev.do#!/reference/api/xanadu/rest/c_ImportSetAPI#import-POST

 

You'd need to create the import set table and relevant transform map to map the inbound data to the target table. The Splunk team can then send a payload to the import set API as documented in the above. 

 

Some additional details https://www.servicenow.com/community/developer-articles/import-set-api-goodbye-srapis/ta-p/2318624