Ivano B
ServiceNow Employee
ServiceNow Employee

Intro

Effective Software Asset Management requires good foundational data as well as data that identifies what software rights are owned and what software rights are in use. 

Software entitlement details are a vital component of Software Asset Management. They identify how many rights you purchased to use software in your environment.  

The process of importing software license entitlements into the platform is streamlined using a Microsoft Excel template. The template is available as part of the Software Asset Management Import Entitlements feature and accessible from the Software Asset > Licensing > Import Entitlements navigation menu.

After completing the file with the necessary data, we can drag and drop the file in the same page and upload the entitlements.

find_real_file.png

 

At first glance, it seems we are following the usual approach involving System Import Sets, probably starting from a dedicated page and leveraging a pre-configured staging table/transform map. Well, wrong answer.

find_real_file.png

 

Taking few steps back

In order to understand the solution, we need to start from the actual page where the import take place.

From the look of the URL, it seems we are dealing with another annoying UI Page. 

find_real_file.png

A quick search in the 'UI page' table tells that we are right.

find_real_file.png

Analysing the Client script section, it is possible to recognise the way data are loaded.

The code uses jQuery to invoke a baseline REST API to load the file.

 

find_real_file.png

The API is available in the list of Scripted Web Services available under 'System Web Services > Scripted Web Services > Scripted REST APIs'.

find_real_file.png The record contains one 'Scripted REST Resource' that fits with the previous code.

find_real_file.png

 

The server-side code included in 'Scripted REST Resource' uses a specific API to parse the content of the excel file and create entitlements records OR entitlement errors records.

find_real_file.png

 

Finally we got our answer. 

Final Summary

The solution is based on a 3 steps strategy leveraging different baseline capabilities of ServiceNow.

find_real_file.png

The same approach can be used for scoped applications in case there is the necessity of importing data through a pre-configured excel file.

Very interesting is the use of the GlideExcelParser API.

The GlideExcelParser methods can be used in global and scoped scripts to parse .xlsx formatted Excel files and access file data in script.

More information and practical example of the library can be found here.

 

Cheers

r0b0_d3vil

find_real_file.png

 

Version history
Last update:
‎09-17-2020 09:42 AM
Updated by: