Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Service Portal Header Menu count

xiaix
Tera Guru

At the header of my Service Portal, I see:

find_real_file.png

I need this number to also count in records from a custom table.   Which widget script do I need to edit to add my custom table?

find_real_file.png

So the "Requests" count should not say 1, but 6

1 ACCEPTED SOLUTION

Erik Stolberg
Tera Guru

In the nav search, type sp_rectangle_menu_item.list, then search for Label = "Requests"



You'll see the commented text about record watchers. Add a new line with your table and filter to include in the count:


// use record watchers to tell header when to update dropdown counts


t.record_watchers = [];


t.record_watchers.push({'table':'service_task','filter':'active=true^opened_by=' + u});


t.record_watchers.push({'table':'incident','filter':'active=true^caller_id=' + u});


t.record_watchers.push({'table':'sc_request','filter':'active=true^requested_for=' + u});


View solution in original post

9 REPLIES 9

Erik Stolberg
Tera Guru

In the nav search, type sp_rectangle_menu_item.list, then search for Label = "Requests"



You'll see the commented text about record watchers. Add a new line with your table and filter to include in the count:


// use record watchers to tell header when to update dropdown counts


t.record_watchers = [];


t.record_watchers.push({'table':'service_task','filter':'active=true^opened_by=' + u});


t.record_watchers.push({'table':'incident','filter':'active=true^caller_id=' + u});


t.record_watchers.push({'table':'sc_request','filter':'active=true^requested_for=' + u});


You, my dear dear friend, are genius!


Hi Erik, where is that code located?  I went to sp_rectangle_menu_item.list and found Request, but do not see anywhere to input code:

find_real_file.png

Make sure you're looking at the one of Type = Scripted List (there are 2 "Requests" records, one might even be called "My Requests").