Issue with Dynamic Filter Option

ArpitB207098286
Tera Contributor

Hi All,

I have a dynamic filter option having a script include (attached image).

It's a simple script returning a list of configuration sys_id's, but it's giving the empty list.

What am I missing here?

2 REPLIES 2

Tanushree Maiti
Giga Patron

Hi @ArpitB207098286 

 

1. For many dynamic filter configurations, the Script Include must be marked as Client Callable to be accessible by the filter engine . You ensure the same.

2. call 

From: new global. SoxUtils().getSoxRelatedCis()

To: (new SoxUtils()).getSoxRelatedCis()

Refer:https://www.servicenow.com/community/developer-forum/why-is-my-dynamic-filter-returning-empty/m-p/13...

 

3.  In script include ,

instead of

return  'sys_idIN' + unique.join(',');    

Use 

return unique.toString()

 

And then call by  new global. SoxUtils().getSoxRelatedCis()

 

Refer:https://www.servicenow.com/community/developer-forum/dynamic-filter-option-returning-empty-value/m-p...

 

4. Line 33 , I have never tried, just before ,after put log and check what your getting.

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:

MariusAlinPopa
Tera Contributor

Hi @ArpitB207098286 ,

 

Make sure to set "Sandbox enabled" to TRUE on your script include.

Test it from a background script first to make sure the sys_id's are being returned correctly from the script include.

 

Also, as @Tanushree Maiti mentioned, remove the 'sys_idIN' part when returning from script include.

 

Let me know if this works,

Marius