The ServiceNow instance comes pre-loaded with out of box Homepage widgets. One of the widgets is 'Gadgets' which contains useful widgets that displays a scrolling list of records, such as high priority incidents or problems. We can easily add and modify existing code to add additional widgets to display the needed information. This KB will walk through how to simply add an additional gadget to display ALL incidents using existing code and UI pages. 



  1. Navigate to UI Page (sys_ui_page) module. Search for the name 'render_gadget_priority_incidents'
  2. We will then create a copy of this UI page. Before doing so, change the name  from 'render_gadget_priority_incidents' to 'render_gadget_all_incidents'. Right-click the header and select 'Insert and Stay'. This will create a copy of 'render_gadget_priority_incidents' with the new name and stay on the current form.
  3. In the 'HTML' section, delete line 6: inc.addQuery('priority',1);. This removes the query for priority 1 incidents and will query the entire incident list. Save the record. 


It should like this:


4. Navigate to the 'Widget' module. Search and select 'Gadgets'.

5. After line 12: 'Knowledge Search' : { 'type' : 'knowledge_search' }, add a comma at the end of line 12 and add the following line underneath: 
'All Incidents' : { 'type' : 'all_incidents' } 

It should look like this:

6.  Save the record. A new gadget will be created called 'All Incidents'. Navigate to the homepage and click New Content > Gadget > All incidents




Additional Information

Create a Widget that displays a UI Page

Article Information

Last Updated:2019-08-02 21:08:28