Dynamic Filter Option with gs.getProperty()

Lukasz Bojara
Kilo Sage

Hello,

Maybe someone can share some light on this case:

Requirement: Filter the list of incidents (Report on Dashboard) based on assignment group sys_id kept in a system property.
Solution: Create a Dynamic Filter option
Problem: Filter returns empty when gs.getProperty() is used in Script Include.

Script Include code (:

function GetDefaultGroup() {
	return gs.getProperty('test.group');
}

find_real_file.png
Dynamic Filter Option Configuration:

find_real_file.png
Result:

find_real_file.png

Additional information:

 - Additional information: Checked with hardcoded sys_id in the script include, it works.

 - Checked configuration without script include and used gs.getProperty() directly, it does not work.

 

Anyone has an idea how to solve it?

9 REPLIES 9

Kalaiarasan Pus
Giga Sage

Do we really need to create a dynamic filter for a single group? Can't you just create a normal filter with visibility as everyone and save it?

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

Hi,

Forgot to mention that the list of incidents is a report used on a Dashborad. The group can be changed but it can not be done by changing the report configurtion.

This may be a bug. When I tried the same on my instance, the script include does not work when I use system property but the same script works when I hardcode a group sys id.

 

Can you try hardcoding the sysid and see if the script works?

Already tried it (have written it in my question at the end). When sys_id is hardcoded it works when using property it does not. I am wondering if the issue is with the fact that the filter is applied on client-side and getProperty is not. Although the script is Client Callable it does not use the GlideAjax.