Advanced Filtering Conditions on Reports

Madhan007
Tera Contributor

Hi Everyone!

In the Workplace Reservation (WSD) table, some reservation records created via integration are being generated with an incorrect Subject value. Specifically, the Subject is populated as Requested for User's Last name , first name

To identify and report on these records, we attempted to schedule a report with a filter condition. A Script Include was created to return the relevant sys_id values, and the report filter was configured using:
sys_id is one of javascript&colon; new <ScriptInclude>().<method>()
However, the filter is returning null.

We also attempted to use a Dynamic Filter, but the dynamic operator is not available when selecting the sys_id field in the report filter conditions.

 
 

 

 

SI.png 

 

 Report.png


Any Insights into this are highly Appreciable.

Thanks in Advance!!

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron

@Madhan007 

use Sandbox Enabled checkbox on your script include so that it's called from report filter conditions

Configuring Script sandbox property 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

6 REPLIES 6

brianlan25
Kilo Patron

I have a report that calls a script include that returns an array. I just use is instead of is one of. Also I notice that your script include is trying to lookup data after you go into your while loop. However I do not see you passing that information to the script include. So were would it get the data to know who the first and last name of the requested for is?

Hi @brianlan25 ,
I tried with "sys_id is" as well. It's not working. 

The required logic to retrieve the sys_ids is implemented within the while loop. I logged the sys_ids before returning the response, and I confirmed that the expected sys_ids are being captured correctly.

Did you look at what @Ankur Bawiskar mentioned? I just looked at mine and Sandbox Enabled is check on mine.

Ankur Bawiskar
Tera Patron

@Madhan007 

use Sandbox Enabled checkbox on your script include so that it's called from report filter conditions

Configuring Script sandbox property 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader