Skip to content

QuickStart

Giles Lewis edited this page Jun 11, 2017 · 16 revisions

This Quick Start Guide assumes that you are using a personal Developer instance of ServiceNow with admin role, and a MySQL database. For other databases you will need to use a different JAR file and make adjustments to the properties file in section 3.

1) Download JAR file

For MySQL you will need a copy of the JAR file sndml-n.n.n-mysql.jar which can be found in the bin.zip file (sndml-n.n.n-bin.zip) which can downloaded from the Releases directory. The "mysql" JAR file contains a bundled JDBC driver for the MySQL database.

2) Configure database access

Create a database named "sndm" and ensure that you are using MySQL credentials that allow you to create tables. Use the following to statements to verify connectivity.

create table sndm.foo (bar varchar(10), primary key(bar));
drop table sndm.foo;

3) Create properties file

Create a text file named sndm.properties as follows. Specify your ServiceNow and MySQL connection parameters.

servicenow.url=https://dev00000.service-now.com/
servicenow.username=admin
servicenow.password=secret
datamart.url=jdbc:mysql://localhost/sndm
datamart.username=admin
datamart.password=secret
datamart.dialect=mysql

4) Create a simple script

Create a file named load_location.txt with a single line as follows:

load cmn_location

5) Run the script

java -ea -jar sndm-n.n.n-mysql.jar -p sndm.properties -f load_location.txt

At this point the application should create a table named cmn_location in your MySQL database, and copy into it the contents of the ServiceNow cmn_location table. If you run the application a second time it will detect that the SQL table already exists. It will match field names between the ServiceNow and SQL tables, and update or insert records using sys_id.

If you have gotten this far successfully, then proceed to Scripts to read about more script files.