darius_koohmare
ServiceNow Employee
ServiceNow Employee

Want to populate a table on your instance quickly with data, without having to mess around with XML or Transform Maps? If so, Easy Import is the feature you've been looking for. Easy Import is a simplified import process that provides a template with only the columns you want to import. It allows you to import data to tables within the current scope, and tables that grant write access to other applications.

In our example, we will be using a free Windows discovery tool, Lansweeper, to take data for a one-time import into our CMDB. In this mock scenario, the user does not have ServiceNow Discovery automatically populating their CMDB with CI data and BSM relationships. In addition, they do not want an integration - just a one-time data load.

lansweeper+discovery+easy+import.png

How to use Easy Import for a one-time import of your current asset data into your CMDB

1. Select the data you want to transfer.

After scanning our network using Lansweeper (or any other program), the first task is to select all the data we want to transfer over and save that data as an xls file.

easy+import+data+load.png

In this example, Lansweeper allows us to do an "Export to Excel." If the program you're using does not have this functionality, you can either copy and paste your data into Excel or export the data as a CSV file and re-open it in Excel to save as xls.

2. Check the format (specifically the column titles and field values).

Once the data from your discovery tool is saved in an xls, ensure the format is set so that row 1 contains all column titles with the relevant data beneath.

easy+import+xls.png

  • It is critical to ensure that any column titles in the xls map directly to columns in ServiceNow (this is case sensitive - ServiceNow CMDB field Operating Systems cannot be written in excel as operating systems)! Set the xls columns to the titles of fields in ServiceNow that you are attempting to map your data to. The order of these columns does not matter.
  • It is equally important to note that the values of the fields need to map to legal values in ServiceNow. This means that if your column has data that imports into a choice field of choices A and B, all values must be A or B in that corresponding column, otherwise data will not import.

In our example, we need to add additional "Operating System" choices such as Linux to map properly to the data in our excel file. We can do this by navigating to Personalize > Form Design.

easy+import+form+design.png

From there, we select the choice field Operating Systems that we need to add choices to.

easy+import+operating+system.png

Using the field editor on the left, we can add all our discovered Operating System choices that are present in our xls but not in our ServiceNow form.

easy+import+field+editor.png

If there is a column in your discovery application that does not exist in ServiceNow, simply create that field using the Form Designer seen above. As long as the column title matches the field name, and the data type matches the field type, the import will be successful.

Tip: if you are unsure what to select, a String field can handle almost every data type! Please note that reference fields require their destination value to exist prior to import).

3. Start the import.

Once all additional fields have been successfully added to the ServiceNow table that you are importing into, the next step is to conduct the actual import.

a. Navigate to the table you wish to import your CMDB data into. In our example, we have an xls list of discovered computers, so we will navigate to Computers and right-click any column header to select Import.

easy+import+cmdb.png

b. From the import view, either:

    • Select Insert if this is the first time you are uploading these assets.
    • Select Update and then Create Excel Template if you are trying to update assets already in your CMDB, to be able to have all the required sys_id's for the update.

Then select the .xls file you created in in steps 1 and 2.

easy+import+upload.png

c. After submitting the import, you will be given a preview of all the data that is being added into ServiceNow. Any errors that have occurred will be listed here as well. In our example, we ca see that we have no errors as all our imported fields are mapping cleanly to fields in ServiceNow!

Note: If your fields are truncating to 40 characters, open a record in the view below, navigate to Form Designer, and edit that variable's max length to be greater than 40 characters.

easy+import+complete.png

You have successfully used Easy Import to do a quick, one-time data load in ServiceNow!

When using Easy Import, there are some properties you need to pay attention to, such as max import row limits (glide.import_template.row_limit) and data type restrictions. For example, by default, Easy Import will not import read-only fields.

For more information on Easy Import, here are some other resources in our Product Documentation and Community:

3 Comments