ServiceNow — Generate Pivot Table from any table in UI Page

ServiceNow
2 min readMay 25, 2021

Generate Pivot Table from any table in UI Page

Here we are going to convert the Pivot table from the list of Incident list generated based on query present in Script Include.

(Note: to get the Script Include and UI Page code click herehttps://bit.ly/2SF68iN)

Follow the Steps to develop Pivot Table in UI Page:

1. Create Script Include to get the records

-> Navigate to System Definitions > Script Includes.
-> Click New to create New Script Include
-> Name: PivotReportValues
-> Client callable: true
-> Script:

(Note: to get the Script Include and UI Page code click herehttps://bit.ly/2SF68iN)

2. Create Script Include to get the records

-> Navigate to System UI > UI Pages.
-> Name: Pivot Table
-> HTML:

(Note: to get the Script Include and UI Page code click herehttps://bit.ly/2SF68iN)

Client Script:

(Note: to get the Script Include and UI Page code click herehttps://bit.ly/2SF68iN)

3. UI Page Output:

UI Page — Pivot table for other tables:

In Script Include modify the table name and query then push the 3 values into the array so that we can generate Pivot Table from the other tables.

URL: https://community.servicenow.com/community?id=community_article&sys_id=024ab2c8dbbb9450a08a1ea66896193e

--

--