Understanding Import Sets in ServiceNow

ServiceNowSimple
1 Mar 202314:06

Summary

TLDRThis instructional video script guides users through the process of importing data into ServiceNow, focusing on the creation and utilization of staging tables. It explains setting up a data source, testing the connection, and observing how ServiceNow automatically generates a staging table based on specified parameters. The script demonstrates loading data into the staging table and introduces the concept of import sets, which help manage records from different import runs, setting the stage for future lessons on moving data to target tables within the ServiceNow platform.

Takeaways

  • 📝 The video script is part of a series on importing data into ServiceNow, focusing on the staging table and import set table.
  • 🔗 In the previous note, a data source was created, which ServiceNow uses to understand the source for the import and to set parameters for the staging table.
  • 📚 The staging table is automatically created by ServiceNow the first time an import is run, based on the parameters set in the data source.
  • 🔍 The script demonstrates testing the data source to ensure the connection works and that ServiceNow creates the staging table and loads data into it.
  • 📊 The staging table, named 'ustest_import' in the example, is shown to be successfully created with data loaded from an Excel file.
  • 📑 The structure of the staging table is displayed, showing custom columns created based on the header row of the imported data.
  • 🔄 When an import is run multiple times, ServiceNow manages the records by creating separate entries in the import set table for each import run.
  • 🗂️ The import set table, 'sys_import_set', keeps track of each import run and associates records in the staging table with their respective import set.
  • 🔗 Each record in the staging table has a reference to the import set it belongs to, showing which import run it was part of.
  • 🚀 The next step, to be covered in the next note, is instructing ServiceNow on how to move the staged data into the target table within the ServiceNow platform.

Q & A

  • What is the primary focus of this note in the series on importing data into ServiceNow?

    -The primary focus of this note is on the staging table and the import set table that ServiceNow creates as part of the import process.

  • What is the purpose of creating a data source record in ServiceNow?

    -The data source record is used by ServiceNow to understand the source it will be connecting to for the import, including what data to pull and parameters for creating the staging table.

  • What parameters are designated for the creation of the staging table in the data source record?

    -The parameters include the desired name and label for the staging table.

  • How does ServiceNow handle the creation of the staging table during the import process?

    -ServiceNow checks if the staging table exists in the database; if not, it creates it based on the parameters set in the data source and then loads the imported data into it.

  • What does the 'table name dot list' command do in ServiceNow?

    -The 'table name dot list' command is used to view the contents of a table in ServiceNow.

  • Why was the staging table not found during the demonstration in the script?

    -The staging table was not found because an import had not been run yet, so ServiceNow had not created the table.

  • What happens when you run an import in ServiceNow for the first time?

    -During the first import run, ServiceNow checks for the existence of the staging table, creates it if it doesn't exist, connects to the data source, pulls the requested data, and imports it into the newly created staging table.

  • How does ServiceNow manage multiple import runs and their data in the staging table?

    -ServiceNow uses an out-of-the-box table called 'sys_import_set' to manage data from different import runs, associating each record in the staging table with a specific import set.

  • What is the purpose of the 'sys_import_set' table in ServiceNow?

    -The 'sys_import_set' table represents a group or set of records inserted into the staging table during each import run, helping to manage and organize data from multiple import processes.

  • What is the next step after creating the data source record and testing the connection in ServiceNow?

    -The next step is to instruct ServiceNow on how to move the staged data into the target table within the ServiceNow platform, which will be discussed in the next note.

Outlines

00:00

📝 Understanding the Staging Table in ServiceNow Data Import

This paragraph explains the staging table's role in ServiceNow's data import process. It discusses the creation of a data source record in a previous note and how this record informs ServiceNow about the data source for the import. The staging table is automatically generated by ServiceNow based on parameters set in the data source record, including its name and label. The speaker demonstrates testing the data source connection and the creation of the staging table, emphasizing the process of loading data into it. The absence of the table before the first import run and the successful creation and data loading after the import are highlighted.

05:03

🔍 Inspecting the Staging Table and Import Set Management

The speaker continues by examining the newly created staging table, showing its structure and how ServiceNow uses the header row from the data source to label the table columns. The paragraph also touches on the concept of import sets and the management of records within the staging table across different import runs. The 'sys_import_set' table is introduced as a tool for tracking different import runs and associating them with records in the staging table. The demonstration reveals that running the import multiple times results in duplicate records in the staging table, each linked to a specific import set, emphasizing the need for careful record management.

10:03

🚀 Preparing for Data Transfer to Target Tables

In the final paragraph, the focus shifts to the next steps after successfully creating the data source and staging table and verifying the import process. The speaker outlines the process of instructing ServiceNow on how to move the staged data into the target table within the ServiceNow platform, which is the ultimate destination for the imported data. The anticipation is set for the continuation of the series, where the details of this data transfer process will be covered.

Mindmap

Keywords

💡Importing Data

Importing data refers to the process of bringing data from an external source into a system or database. In the context of the video, it is about transferring data into ServiceNow, a cloud-based platform. The script discusses the steps involved in setting up the data source and the staging table for successful data import.

💡ServiceNow

ServiceNow is a cloud-based platform that provides a range of services for IT, customer service, human resources, and other enterprise operations. The video script focuses on how to use ServiceNow for importing data, highlighting its capabilities to handle data sources and staging tables.

💡Staging Table

A staging table is a temporary storage area for data that is being imported into a database. In the script, the staging table is created by ServiceNow during the import process to hold the data before it is moved to the target table. It is crucial for managing and organizing the data load.

💡DataSource Record

A data source record is a configuration within ServiceNow that defines the external source of data to be imported. The script explains how to create a data source record, which includes specifying parameters such as the data to be pulled and the naming of the staging table.

💡Import Set Table

The import set table, or sys_import_set, is an out-of-the-box table in ServiceNow that tracks the groups or sets of records being imported. The script mentions this table to illustrate how ServiceNow manages different import runs and associates records with specific import sets.

💡Table Name

In the context of databases and the script, a table name is the identifier for a specific table where data is stored. The script describes how ServiceNow uses the table name specified in the data source record to create the staging table.

💡Label

A label in ServiceNow is a user-friendly name given to a table or record for easier identification. The script uses the term 'label' to refer to the user-friendly name set for the staging table during the data import setup.

💡Excel File

An Excel file is a type of spreadsheet document created by Microsoft Excel, often used for storing and organizing data. The script mentions an Excel file as the data source from which ServiceNow pulls data during the import process.

💡Test Load

A test load is a trial run of the import process to verify the connection and data transfer without affecting the live system. The script describes using the test load feature in ServiceNow to ensure the data source and staging table are functioning correctly.

💡Record

In the context of databases, a record represents a single row of data within a table. The script discusses records in relation to the data being imported into the staging table and how ServiceNow processes these records during import runs.

💡Import Run

An import run refers to a single execution of the data import process. The script explains how each import run is recorded in the import set table and how it affects the records in the staging table, with each run adding a new set of records.

Highlights

Introduction to importing data into ServiceNow and the importance of the staging table.

The staging table, also known as the import set table, is created automatically by ServiceNow during the import process.

In the previous note, a data source record was created to define the source from which data will be imported.

ServiceNow uses the data source record to understand the data source, pull the specified data, and set parameters for creating the staging table.

A demonstration of using the personal developer instance to view the sys_data_source table.

Explanation of how to view the contents of a table in ServiceNow using the application navigator filter.

Overview of the process for testing a data source connection in ServiceNow.

Steps to test loading records into the staging table from a data source.

ServiceNow automatically checks if the staging table exists before creating it based on the data source parameters.

ServiceNow creates the staging table and loads data when an import is run, showing the successful processing of records.

Description of how to view the structure and layout of a table in ServiceNow.

Staging tables in ServiceNow are extended from the import set row table.

Details on how ServiceNow uses the data source record to create custom columns in the staging table.

Explanation of the difference between staging tables and import set tables in ServiceNow.

The importance of managing records in the staging table based on import runs.

ServiceNow inserts a record into the import set table for each import run, linking records in the staging table to their respective import runs.

ServiceNow allows viewing import set records and their associated staging table records to track data import processes.

Demonstration of running multiple imports and how ServiceNow manages these imports using the import set table.

Details on how to view the records in the staging table and their association with specific import runs.

Final steps to move data from the staging table into the target table within the ServiceNow platform.

Preview of the next steps, focusing on transferring data from the staging table to a target table.

Transcripts

play00:00

Note 3 in our series of notes on

play00:03

importing data into servicenow and in

play00:06

this note

play00:08

I focused on

play00:10

the staging table the import set table

play00:12

that service now creates is part of

play00:15

the import process if you have been

play00:17

following along in the series you'll

play00:19

remember that in the last note

play00:21

we talked about the creation of a data

play00:24

source we went in and we created a data

play00:25

source record

play00:26

that record is used by servicenow to

play00:30

understand the source that we will be

play00:33

connecting to for the import

play00:35

we tell it in the data source record

play00:37

what data we would like for it to pull

play00:39

and then we also designate some

play00:42

parameters for the creation of the

play00:43

staging table

play00:45

including what we'd like that table

play00:47

named and the label that we would like

play00:49

set to that table

play00:51

at this point we are ready to give that

play00:55

data source a test drive see that the

play00:58

connection Works see that servicenow

play01:00

creates the staging table and that the

play01:03

data gets loaded into the staging table

play01:05

so

play01:06

again we're going to pop back into our

play01:08

personal developer instance that I've

play01:10

got set here and we're going to review

play01:12

real quickly what we did in the last

play01:14

note so we created a data source record

play01:16

and I know those are stored in the sys

play01:18

data source table so I'm going to enter

play01:20

sys

play01:22

data

play01:24

Source dot list

play01:26

anytime you want to see the contents of

play01:28

a table you can do the table name dot

play01:30

list in the application navigator filter

play01:32

here is our import our sorry our data

play01:36

source that we created in the last note

play01:38

I'm going to go ahead and open that up

play01:40

and point out a couple of things for us

play01:42

to take a look at and remember these two

play01:44

attributes right here specified for the

play01:48

import set table and that's the that's

play01:50

the staging table

play01:51

this is the label we're using test

play01:53

import and this is the table name the

play01:56

actual database table name is U

play01:58

underscore test underscore import

play02:01

I mentioned in the last note that

play02:03

servicenow automatically creates that

play02:05

staging table as part of the import

play02:08

process the first time an import is ran

play02:12

servicenow will check the database to

play02:14

see if that staging table exists if it's

play02:17

not it will go ahead and create it based

play02:20

upon the parameters that we've got set

play02:21

here in the data source and it will then

play02:24

load the data that it's pulled on the

play02:28

import run into that staging table where

play02:30

it sits and gets ready to be prepared to

play02:33

actually load into the target so just to

play02:36

show you I'm going to go ahead and

play02:38

select the name of this table here

play02:40

and just like I did before I'm going to

play02:42

go to my filter Navigator and I'm going

play02:44

to put the table name dot list

play02:47

to view the contents of that table

play02:49

and you're going to see that um

play02:52

servicenow is telling us well I can't

play02:54

find that table that table doesn't exist

play02:56

so we get a little

play02:58

I guess you'd call it an error message

play02:59

saying this um this table is not there

play03:02

so the reason it's not there is we

play03:04

haven't ran an import yet so we've

play03:06

specified what we want servicenow to

play03:08

create it as but we haven't ran an

play03:11

import and so servicenow hasn't gone in

play03:13

and actually created that table yet so

play03:15

that's going to be the next step let's

play03:16

run an import and see how our data

play03:18

source works so

play03:20

go back to our data sources sis

play03:24

underscore data

play03:27

Source oops

play03:31

that list whoops type of type

play03:34

dot list

play03:40

I still didn't get it today l i

play03:44

t

play03:47

okay there's our data source that we

play03:48

created in the last note

play03:51

I'm going to open it up

play03:54

and you're going to see that once you've

play03:56

got the data source created and you can

play03:58

see we've got our file attached here

play04:00

which is actually our our data source

play04:02

we're pulling from an Excel file you

play04:04

have a couple links down here in the

play04:05

related links area that allows you to

play04:07

test

play04:09

um your data source and

play04:13

load some data so we're going to go

play04:15

ahead and do that remember if you

play04:16

remember our little spreadsheet has five

play04:18

rows

play04:19

servicenow gives you an option option

play04:21

here to test load 20 records or load all

play04:24

the records in the data source in this

play04:27

case it doesn't matter because 5 is less

play04:30

than 20. so I'm just going to go ahead

play04:32

and select load all records

play04:35

servicenow is now going to go to the

play04:38

data source

play04:39

it's actually the first thing it's going

play04:41

to do is it's going to check to see if

play04:42

that staging table is there it's going

play04:43

to see that it's not we just proved that

play04:46

it's going to create it based upon the

play04:48

parameters that we have set in our data

play04:51

source it's then going to connect to the

play04:53

data source pull the the rows that we've

play04:56

requested and then import those rows

play04:59

into that new staging table that it

play05:02

created and when it's all done we'll get

play05:04

a nice message here that tells us it

play05:06

completed successfully and it shows us

play05:07

that it processed five inserts

play05:11

um it processed five records and it was

play05:13

five inserts into our staging table

play05:16

so very good so we're now going to

play05:18

return to our

play05:22

um data source

play05:24

and I'm going to do what I just did a

play05:27

moment ago but show you this time that

play05:28

now that table has been created so our

play05:30

import set table named utest import

play05:36

I'm going to pop that in here

play05:38

and I'm going to do a DOT list

play05:41

on that table

play05:43

and there it is we now have the table

play05:46

staging table created

play05:48

and we have five rows in the table so

play05:52

the five rows that it that it found in

play05:54

our spreadsheet it pulled in and it put

play05:56

into our staging table

play05:58

real quickly I'm going to show you what

play06:00

the staging table looks like the layout

play06:02

of it

play06:03

anytime you want to get to a table to

play06:07

view the actual structure of the table

play06:08

when you're viewing a list you can um

play06:11

click on the hamburger menu of any of

play06:14

the columns and you can go down to

play06:16

configure

play06:18

table and it will actually show you the

play06:20

configuration of that table so what I

play06:23

really wanted to show you here is yes

play06:24

indeed it did set the label the way we

play06:26

ask it to it did set the name the way we

play06:29

ask it to

play06:31

um all import set tables or staging

play06:33

tables extend the import set row table

play06:36

we'll talk about extensions in another

play06:38

note but what I really wanted to show

play06:39

you was these columns these are the

play06:42

column list the columns with the red X

play06:44

are custom columns so they're columns

play06:48

that that weren't out of the box for the

play06:49

table and you can see that servicenow

play06:52

used that

play06:53

um

play06:54

our header row to label those table

play06:57

those columns so you can see we've got

play06:59

an address a city a name a state

play07:03

and um

play07:06

let me see how many table together 23

play07:08

rows here we'll have a zip

play07:10

we'll have a zip column as well so

play07:13

servicenow used the data that we had set

play07:15

in the data source record to create that

play07:17

staging table and load the five records

play07:19

into that table

play07:21

so

play07:22

we now have data in our staging table

play07:26

one more thing I wanted to show you to

play07:27

help understand import sets the staging

play07:30

table I'm going to go back to the data

play07:32

source so

play07:34

um sis

play07:35

data

play07:37

Source dot list

play07:40

I'm going to go into our data source our

play07:42

test import data source here and I'm

play07:45

going to run it again so let's say now

play07:48

we want to run our input we're going to

play07:49

run our import a second time

play07:52

um and I'm just going to go ahead and do

play07:53

load all records again

play07:56

you can see now that the servicenow uh

play08:00

successfully came back with a message

play08:01

saying it was success it processed five

play08:03

and it inserted five rows so let's go

play08:07

back

play08:09

and let's look at our import set

play08:13

staging table now

play08:16

go here paste

play08:18

dot list to see the records and now

play08:21

we're going to see there are 10 records

play08:23

here so we've got the five records but

play08:27

we've loaded them twice

play08:30

um

play08:31

and the point I'm making here is that

play08:33

it's going to be important for us to be

play08:34

able to manage the records that we load

play08:37

in our staging table

play08:39

based upon the import run

play08:42

that was requested so we actually have

play08:45

10 rows here but they were actually

play08:48

added to the staging table in two

play08:51

separate import runs we did it the first

play08:53

time we got five we did it the second

play08:54

time we got five surface now provides an

play08:57

out of the box table

play08:59

um

play09:00

that allows us to manage the data that's

play09:05

being loaded in our staging table into

play09:07

the runs or the groups that they belong

play09:10

to and the name of that table is this is

play09:13

where it gets confusing the name of that

play09:15

table is import set and that's why I

play09:18

refer to the staging table as a staging

play09:20

table not an import set table because

play09:22

there actually is an import set table

play09:25

it's an entirely different thing so

play09:28

let's take a look at the staging now

play09:29

import set table this is an out of the

play09:32

box table from servicenow the name of it

play09:35

is sys underscore import

play09:38

underscore set

play09:39

I'll do a DOT list on that

play09:43

you're going to see oops we have three

play09:45

and that is because I didn't clear

play09:47

something out

play09:49

um let me see 825 826 826 this one I'm

play09:52

going to get rid of because it was from

play09:55

me experimenting yesterday

play09:58

sorry that makes my demonstration a

play10:00

little confusing but if I hadn't clear

play10:03

if I cleared that out from yesterday

play10:05

um

play10:06

you can see that we have two records

play10:08

here uh that were executed uh today and

play10:12

that was our first import run which was

play10:14

I set 36 and our second import run which

play10:18

is I set 37. the way this works is

play10:21

whenever you run and import the first

play10:23

thing servicenow does is

play10:26

um is insert a record into this import

play10:29

set table

play10:31

that represents the run or the set of

play10:35

records that are going to be inserted

play10:37

into the staging table

play10:39

so the first time we ran the import we

play10:41

got this we inserted this row and we got

play10:45

iset10036 is is the number of that

play10:48

we then loaded those five records into

play10:50

the staging table

play10:51

as they were loaded into the staging

play10:53

table they all got a value populated in

play10:57

one of their columns that tied it to

play10:58

this import set run

play11:01

so I set 36 was the first one

play11:04

we then went and ran a second import for

play11:08

that same data source and servicenow

play11:10

inserted a second row into this import

play11:12

set table and it it has a value of 37 as

play11:16

its number

play11:18

it then

play11:19

um went ahead and reloaded the same five

play11:21

rows into the staging table because

play11:23

that's what we ask it to do but it

play11:25

marked each of those with

play11:28

this second import set reference it's

play11:31

actually using sysids behind the scenes

play11:33

to make these connections but talk about

play11:35

that later

play11:36

so if I go back now to our staging table

play11:38

let me go to our data source

play11:46

back to our data source here

play11:50

this is our actual staging table

play11:53

what they call an import set table which

play11:56

confuses me dot list

play12:00

the 10 records are here but you can see

play12:02

there is a set attribute for each of

play12:04

them and you're going to see that if I

play12:06

sort by that

play12:09

there's one two three four five rows

play12:13

that are tied to the 36 run and there

play12:17

one two three four five rows that are

play12:20

tied to the 37 run so this picture on um

play12:24

in the note attempts to make that kind

play12:27

of connection and it took me a little

play12:28

bit to understand the purpose of all

play12:30

this but the import set out of the box

play12:33

table

play12:34

each record represents a group or a set

play12:37

of records that were inserted into the

play12:40

staging table

play12:41

and we can see we have two groups

play12:44

two records there and then the actual

play12:47

records in the staging table itself

play12:50

have a link or reference back to the

play12:54

import set group that they belong to so

play12:57

in this case the picture shows three

play12:59

records with the first import run three

play13:02

records with the second import run

play13:05

so at this point we have created our

play13:08

data source record the tell servicenow

play13:11

about our source data how to connect to

play13:13

it what data we want pulled how we want

play13:15

the um

play13:16

the staging table named we have then

play13:20

tested our data source and we've saw

play13:22

that the connection works we saw that

play13:24

the staging table was created the way we

play13:27

asked for it to be we saw that the data

play13:29

was loaded into

play13:31

the staging table I mean we validated

play13:34

that all of that works the way that we

play13:36

expect

play13:37

so we have data in the staging table our

play13:40

next step is to tell servicenow okay

play13:43

here's how I want you to take this data

play13:46

that we have staged and actually move it

play13:49

into the target table which will be a an

play13:52

existing table in the servicenow

play13:54

platform where we finally want this data

play13:57

to be loaded

play13:59

um and we will be talking about that in

play14:01

the next note so I'll see you all there

Rate This

5.0 / 5 (0 votes)

Etiquetas Relacionadas
ServiceNowData ImportStaging TableImport SetDataSourceExcel FileImport ProcessTable CreationRecord ManagementData LoadingIT Automation
¿Necesitas un resumen en inglés?