Show Widget even when Empty

zachbarr
Mega Contributor

Hi all,

See below. I want to have the "My Open Requests" to show even when there is no Open Requests as shown with the "My Open Incidents".  

Can someone show me in the right direction of where this is set?

find_real_file.png

find_real_file.png

7 REPLIES 7

Ripu Daman1
Tera Expert

"Show even when empty" checkbox does NOT show up OOB/By Default/Automatically. We have to configure 'Widget Options schema' with a Boolean type variable and then use this variable in the angular template.

This is how you can configure Widget Options schema to get the checkbox "Show even when empty":

find_real_file.png

find_real_file.png

 

After saving the widget options schema you will get the checkbox "Show even when Empty". 🙂

 

Don't forget to use this variable in your html code: example -> ng-if="c.data.isValid && (c.options.always_show || c.data.filterText || c.data.list.length)">

 

 

 

Note: It works for Instance and Instance of simple list as well. Hope it helped! : )

 

patricklatella
Mega Sage

I'm having the opposite problem...I have simple list widgets that have the "Show even when empty" box unchecked, but the widgets are still showing when empty.  Any ideas why this would be?  I'm testing as a non-roled end user and the widgets are still showing.  Here are a couple screen shots from one of them.

 

find_real_file.png

 

find_real_file.png

Ripu Daman1
Tera Expert

Hi Patrick,

 

Can you post the widget code here. The might be that the widget is not looking at the instance option variable. Sometimes ServiceNow does this with OOB widgets for backward compatibility that it will have instance options but that widget doesn't leverage the instance option variable. In such cases you have to clone the widget and add your logic to the widget.