How do I make a widget to display number of open Cases, incidents, and requests

Oscar14
Tera Contributor

Hello, I need to make a single widget to display the number of open Cases, incidents, and requests. I don't need any help with the styling. I just need help with the functionality with client script, server script, link function. If there are no open cases display '0'. For example:

cases: 0

incidents:2

request:0

1 ACCEPTED SOLUTION

GlideAggregate each table and do get the count, that is something I am talking about. 

Go through this to understand how to use GlideAggregate

https://developer.servicenow.com/blog.do?p=/post/glideaggregate/

 

View solution in original post

4 REPLIES 4

suvro
Mega Sage
Mega Sage

In the server script, you need to GlideRecord all the tables and store the count like this

data.incident_count = something

data.case_count = something

data.request_count = something

 

Same variables you can use in your html part to print it.

 

Go through this, it will help you a lot

https://community.servicenow.com/community?id=community_article&sys_id=c379b963db726700d6a102d5ca96199f

Oscar14
Tera Contributor

What goes in the 'something'?. Didn't quite understand that.

 

GlideAggregate each table and do get the count, that is something I am talking about. 

Go through this to understand how to use GlideAggregate

https://developer.servicenow.com/blog.do?p=/post/glideaggregate/

 

suvro
Mega Sage
Mega Sage

Depending upon where do you need to showcase this

Your requirement can be done easily with reports of type score card.