Reporting on ServiceNow Variables
Contents
Introduction
This page applies to list views using a ServiceNow data source.
Variables
ServiceNow has a special type of field called Variables. This field holds a set of questions and answers.
Variables are commonly used in the Service Catalog. When a user makes a service request such as requesting the purchase of a new computer, they fill a form in which they answer questions such as the amount of memory required and the size of the hard drive. These questions and answers are placed in variables.
Variables may also be used in tasks such as incidents and in workflow. The name of the variables field in all these ServiceNow tables is "variables".
The Challenge with Variables in Reporting
Variables are not like normal fields. They hold multiple names and values (questions and answers). To list several variables in columns of a list, you need to select "variables" multiple times, each time selecting another variable name (question).
Support for Variables in Explore Analytics
Explore Analytics supports variables in List views. The following section shows an example of creating a list of Requested Items.
Using Variables in a List
To see how to use variables in a list, let's see an example, and then show how to create it. This example shows requests for computers. For each request, we show four variables (the last four columns in the list):
- Memory
- CPU
- Hard Drive
- Operating System
Step-by-Step: Adding a Variable to the List
Step 1: select the "variables" field
To add a variable to the list, drag the "Variables" field from the list of fields to the Selected Fields below. This is depicted in the following picture.
The variables field may be a direct field of the table, or may be a field of a related table as shown in the next image.
Step 2: select a variable name
After we drag the "Variables" field to the Selected Fields, the field settings dialog pops up. To display the amount of memory for the requested computer, we need to specify the variable name: "memory". We type that into the Variable Name field. A label (column heading) is automatically generated, but you can change it if you like.
That's all it takes to show the memory variable as a column in our list.
Step 3: repeat for any additional variable name
We go back to step 1 and select "Variables" again. The settings dialog appears (step 2) and this time we'll enter the variable name "cpu_speed" and give it the label "CPU".
Limitations
Currently, variables cannot be used in filters and therefore the options to "Show Matching" and "Exclude" are not available for those columns. Sorting is also not currently available for those columns.
Support for variables in Pivot and Chart views is planned for the near future, so please stay tuned.
A useful tip
The functionality available in the list opens up many possibilities if you realize that you can save that list and then use it as a regular table in which you can filter, sort, pivot and chart all the list fields including the ones that were created from variables. There are a couple of ways to turn your list into a table in Explore Analytics.
- You can export the view data (File | Export this view's data) into a CSV file. You can then turn around and upload this file and store it as a table in Explore Analytics.
- The track trend feature allows you to run a view and save its output into a table. You can simply create a track trend job that runs once.