Wanting to Import data using external REST service on a schedule using Import Set / Transform Map

james_whitt
Kilo Contributor

We're running into an issue where right now we are using Scheduled Jobs to kick off a script include that uses a MID Server to connect to a 3rd party system for importing data into a ServiceNow table directly. What we want to do is use Import Sets and Transform maps also, so that we aren't pulling for 3rd part software using REST and entering data directly into the tables using the script.

With that said, we are stuck on figuring out how exactly how to "Load Data" into the import set and then kicking off then "Run Transform". We know the transform map needs to be asynchronous and that if we were using odbc, file, xml, we would go the Import Sources route, but we can't. Have to be ServiceNow scheduled import using MID server to consume the REST services.

Any help would be appreciated.

48 REPLIES 48

john_andersen
Tera Guru

I may be oversimplifying this, but why not use Scheduled Imports?

http://wiki.servicenow.com/index.php?title=Scheduling_Data_Imports

You would just create a data source that pulls the data via file, HTTP, JDBC, etc from the third party source. This would automatically bring the data in through an Import Set and Transform Map. These results would automatically be processed without user interaction.


That's what we want to do, but the only access to the remote data is using a REST Service. My understanding is to do the scheduling data imports, we will need to have either a File, LDAP, or JDBC way of grabbing it, which none of which we can do (without getting into, in my opinion, more complicated solutions).


john_andersen
Tera Guru

Thanks for clarifying. The way I would approach it is to make the REST call to the third party and then take the responding data and instead of having the scheduled script set the data into the table directly, load it into the Import Set table directly.

This will automatically trigger the mapping and the transform of the data and will update the proper table automatically.


Maybe I am missing something ,and I am fairly new to the Integration side of SN, but how do we actually post the XML or JSON response from a REST call straight to the Import Set table through a script. I think my brain is making this more difficult that it should be. NOTE: via the REST module in Berlin we are successfully making GET calls and can see success via logging. Our current REST call returns and XML file...how do we, via scripting, load that into a table?

Any pointers in the right direction would be most helpful!