Script: prevent records from showing in Analytics Hub of Widget (ignore=true not working)

VincentLastname
Tera Expert

I'm writing a script that is looking at Service Level Agreements, SLA. for tickets.

There can be multiple SLA's per ticket, so we've decided to only consider the newest one. 

The ServiceNow filters in the Indicator Source are not robust enough for my needs, so I've turned to a script to filter out non-current SLA's. 

 

The issue I'm encountering is that I can't figure out how to prevent these records from showing up in the Analytics Hub of whatever widgets use these Indicators.  "ignore=true" in the script  not only doesn't appear to do this,  it doesn't even prevent records from being processed or counted. 

 

Here is the script I am using for my Indicator (with the "ignore=true" commented out b/c I switched from Count Distinct to Sum) 

Script for Indicator.png

 

Regardless if I use "ignore=true" or not, duplicate records show up in the Analytics Hub

Analytics Hub Showing multiple per Task.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Am I doing something wrong? Please help

 

1 ACCEPTED SOLUTION

Sorry I didn't reply sooner. 

I checked out your link, but looks like the admins haven't granted us access to that module. I would ask them for permission BUT I did find a solution on my own.

 

My solution:

return the value (aka just type the variable) and THEN do ignore=true.

not sure why this works but it does

View solution in original post

2 REPLIES 2

Hasan6
ServiceNow Employee
ServiceNow Employee

Hi Vincent,

Might I suggest a workaround, instead of writing a script to ignore records from the table, write a scripted filter to get the exact records you need.

https://docs.servicenow.com/bundle/vancouver-platform-user-interface/page/use/using-lists/task/t_Scr...

Best

Hasan

Sorry I didn't reply sooner. 

I checked out your link, but looks like the admins haven't granted us access to that module. I would ask them for permission BUT I did find a solution on my own.

 

My solution:

return the value (aka just type the variable) and THEN do ignore=true.

not sure why this works but it does