Use this quickstart lab to configure and understand the Snowflake Connector for ServiceNow® using the Snowsight wizard, select some tables, ingest data, and run an example query. This quickstart is not meant to be exhaustive. Please check the Snowflake Connector for ServiceNow® documentation for full functionality and limitations.
A ServiceNow® to Snowflake ingestion data flow.
If you do not want to test this connector on your ServiceNow® account, no problem, this step explains how to set up a developer instance!
Deployment is usually pretty quick, around five minutes. But, while you wait, let's go to the next step and configure Snowflake!
If you do not have a Snowflake account, no problem, you can get a free trial at snowflake.com. Select Start for Free and follow the instructions.
You'll need some compute for the connector installation process, so let's set up a virtual warehouse to do that.
Change to the ACCOUNTADMIN role.
The connector, the first of its kind to be deployed on Snowflake's Native App Framework, is delivered through the Snowflake Marketplace, and is available to all Snowflake customers instantly. Once chosen, it is installed into your account as an application with several views, and stored procedures.
Let's check that the connector was installed. From Snowsight, go to Data Products -> Apps. You will see a new installed application with the name Snowflake_Connector_for_ServiceNow.
Take a look at its public schema in Data -> Databases to see what views and procedures are available.
Launch the Snowflake Connector for ServiceNow® from the Data Products -> Apps -> Snowflake Connector for ServiceNow. You will be presented the list of tasks that need to be done before you'll be able to start the ingestion of the data. Please read the descriptions carefully and complete them one by one.
One of the last steps asks you to create application registry if you want to use OAuth2 authentication. Let's focus on it for a while.
Please have two tabs in your browser open for the next part, as you will have to copy some data from Snowflake to ServiceNow®.
Now, open a new tab in your browser (without closing the above), and follow the steps in the next section.
Now, time to jump back to the Snowflake configuration tab.
When all the preparation tasks are done, move to the next step by clicking Start configuration
This displays the Configure screen. By default, the fields are set to the names of objects that are created when you configure the connector. You can also provide names of existing objects.
The virtual warehouse that you need to choose now will be used by the connector for background data ingestion processes.
Check out Configuring the Snowflake Connector for ServiceNow® for more information on these fields.
Select Configure. It can take a few minutes for the configuration process to complete, and you will be moved to the next step.
To verify the connection, select the three dots [...] and View Details. At the top of the pop-up you will see the date ServiceNow Authenticated.
If you want not only inserts and updates, but also deletes to be synchronized to Snowflake, you have to provide name of the journal table. By default ServiceNow® uses sys_audit_delete
table to store information about deleted records so feel free to provide this name. If you don't care about deletes, you can leave this field empty.
Select Validate to check if the connector is able to connect to the source system and has access to all the required tables. It can take a few minutes for the process to complete. When it's done, please select Define data to sync to select tables for the ingestion.
You receive a message indicating success. It appears once at least one table has been fully ingested.
Let's open a worksheet to check what's going on inside the connector. Here are some examples of SQL queries you can execute to get monitoring information:
// Get general information about all ingestions
SELECT * FROM SNOWFLAKE_CONNECTOR_FOR_SERVICENOW.public.connector_stats;
// Search for information about particular table ingestions
SELECT * FROM SNOWFLAKE_CONNECTOR_FOR_SERVICENOW.public.connector_stats WHERE table_name = '<table_name>';
// Check connector configuration
SELECT * FROM SNOWFLAKE_CONNECTOR_FOR_SERVICENOW.public.connector_configuration;
// Calculate ingested data volume
SELECT
table_name,
sum(ingested_rows) AS row_count
FROM SNOWFLAKE_CONNECTOR_FOR_SERVICENOW.public.connector_stats
GROUP BY table_name
ORDER BY table_name;
// General connector statistics
SELECT * FROM SNOWFLAKE_CONNECTOR_FOR_SERVICENOW.public.connector_overview;
The connector exposes an application role named DATA_READER
. It has read access to all the ingested data in the destination schema. It's automatically granted to the role provided during the Configure step of the installation process. It was named SERVICE_NOW_RESOURCES_PROVIDER
in the screenshot earlier in this guide. You can grant either application role or account role further if needed.
Check out the tables that the connector has created under the destination schema of the destination database. For each table in ServiceNow® that is configured for synchronization, the connector creates the following table and views:
To query from the raw data, check out Accessing the raw data. To query the views (recommended), check out Accessing the flattened data.
Here's a little test query for you to identify the number of incidents raised by month and priority. Other example queries are provided on the Snowflake Connector for ServiceNow® page in the Marketplace.
USE ROLE SERVICE_NOW_RESOURCES_PROVIDER;
USE DATABASE SERVICENOW_DEST_DB;
USE SCHEMA DEST_SCHEMA;
WITH T1 AS (
SELECT
DISTINCT
T.NUMBER AS TICKET_NUMBER,
T.SHORT_DESCRIPTION,
T.DESCRIPTION,
T.PRIORITY,
T.SYS_CREATED_ON AS CREATED_ON,
T.SYS_UPDATED_ON AS UPDATED_ON,
T.CLOSED_AT
FROM TASK__VIEW T
LEFT JOIN INCIDENT__VIEW I
ON I.SYS_ID = T.SYS_ID -- ADDITIONAL INCIDENT DETAIL
WHERE I.SYS_ID IS NOT NULL -- THIS CONDITION HELPS KEEP JUST THE INCIDENT TICKETS
)
SELECT
YEAR(CREATED_ON) AS YEAR_CREATED,
MONTH(CREATED_ON) AS MONTH_CREATED,
PRIORITY,
COUNT(DISTINCT TICKET_NUMBER) AS NUM_INCIDENTS
FROM T1
GROUP BY
YEAR_CREATED,
MONTH_CREATED,
PRIORITY
ORDER BY
YEAR_CREATED,
MONTH_CREATED,
PRIORITY
;
The connector exposes two more application roles except the one we used to access the data in destination database:
VIEWER
role have read only access to the connector configuration and stateADMIN
role that can modify connector configuration and enable/disable ingestion If you would like to monitor errors, run stats, connector stats, enabled tables, you can set up a ServiceNow® monitoring role that allows access to the views and read only procedures in the connector database. For example, run the following in a worksheet (and then use the role):USE ROLE accountadmin;
CREATE ROLE IF NOT EXISTS servicenow_monitor_role;
GRANT APPLICATION ROLE SNOWFLAKE_CONNECTOR_FOR_SERVICENOW.viewer TO ROLE servicenow_monitor_role;
GRANT USAGE ON WAREHOUSE SERVICENOW_WAREHOUSE TO ROLE servicenow_monitor_role;
During this lab, we're only ingesting the data, so it makes sense to stop the ingestion after that initial load. However, in an operational environment, you would keep it running.
If you completed the experiment or for any reason no longer need the connector you can easily uninstall it via the Snowflake Marketplace.
Congratulations! You've successfully installed and configured the Snowflake Connector for ServiceNow®, ingested data and ran a query to get some insights on incidents and priority!