logo

NJP

ServiceNow – Generate Pivot Table from any table in UI Page

Import · Oct 07, 2020 · article

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 here --> https://bit.ly/2SF68iN)

image

Follow the Steps to develop Pivot Table in UI Page:

1. Create Script Include to get the records

-> Navigate to .

-> Click New to create New Script Include

-> Name: PivotReportValues

-> Client callable: true

-> Script:

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

image

2. Create Script Include to get the records

-> Navigate to .

-> Name: Pivot Table

-> HTML:

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

image

Client Script:

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

image

3. UI Page Output:

image

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.

image

View original source

https://www.servicenow.com/community/developer-articles/servicenow-generate-pivot-table-from-any-table-in-ui-page/ta-p/2316806