There are so many ways to get information from a 3rd-party system into ServiceNow and back. It can be done via web services, JDBC, email, file transfer, etc. Let’s say a customer wants to send a CSV file to the ServiceNow instance, they have a couple of choices: attach the file manually to a data source or place the file on an FTP(s) server. Oddly, there is no option to simply have the mid server send the file directly to the ServiceNow instance to be processed by an import set. This is a very common complaint/recommendation that I hear from customers.
Placing a file on an FTP server is typically a good idea, especially when that file will be used by other vendors and you want a common location for these CSV files to be retrieved. This is not always an easy thing to do, however, when there is no public-facing FTP(s) server available and you simply need to send a CSV of users, for example, to ServiceNow.
Introducing, the Scheduled File Importer.
The Scheduled File Importer gives the mid server the ability to send a file that exists on the same machine (or on a mapped drive) directly to a ServiceNow import set table that has been created previously in your instance.
When this update set is installed, a new section in the Mid Server Application will appear called File Importer. This section contains three modules, each of which I’ll cover briefly: Scheduled File Import, Scheduled File Transform, and File Import History.
- The Mid Server plugin needs to be installed.
- The CSV file should be added to a data source via an attachment and then imported. This will create an import set table into which you may import your data.
- A transform map should be defined for the import set table in order to map the file being sent from the mid server into a target record.
Scheduled File Import
This module allows an admin to schedule the import of a CSV file from a mid server. As shown below, it only has a few fields to define, each of which are pretty self-explanatory.
The only thing to note from these fields is that the import set table that is specified in this record should already exist in the system.
When a scheduled file import record is created, it will run on a scheduled interval that is defined by the record. When the data is imported, it is added to the import set table in a Pending state (not yet transformed). Because of this, you have the freedom to load many different files into a particular import set table before a transformation occurs.
Scheduled File Transform
This module is merely a script that can be configured to run on a defined interval. It looks for all import set tables that are defined in any scheduled file import record and transforms them all.
A transform map must be defined for the import set table in order to process any of the pending records.
File Import History
Whenever a scheduled file import is run, there will be two corresponding entries in the ecc_queue. The first entry is the outgoing communication to the MID server. In this case, it sends the mid server the command to fetch a file, gives it the file location, and tells it what import set to send the data to. The second entry contains the raw results of the command.
This module filters the ECC queue for entries that pertain to this solution. Â These entries can be quite valuable when debugging efforts are required.