Client Callable Script include issue as script filter in reports

yashu1995
Kilo Guru

Hi All,

 

We have a requirement to generate report to revoke ITIL licenses of users.

in that report the

conditions are Logged in at or before Last 30 days. Few Exception Users & Few Exception Groups.

 

I created a report on sys_user table

find_real_file.png

To get data i have written client callable script include:

find_real_file.png

if i add static values in script like direct 'itil' and '30' in scripting its working and data is coming in report.

 

When i call the value using property no data is showing up in report. Kindly help me.

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

gs.getProperty() won't work in client callable script include when it's called from a reporting filter condition as it will be executed on client side.

I have faced similar challenge earlier and was surprised to know this drawback.

Instead you can query sys_property table with that property name and get the value.

Check this link which talks the same which all classes are not allowed

Script sandbox property

Regards
Ankur

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

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

gs.getProperty() won't work in client callable script include when it's called from a reporting filter condition as it will be executed on client side.

I have faced similar challenge earlier and was surprised to know this drawback.

Instead you can query sys_property table with that property name and get the value.

Check this link which talks the same which all classes are not allowed

Script sandbox property

Regards
Ankur

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

@yashu1995 

Hope you are doing good.

Did my reply answer your question?

If my response helped please close the thread by marking appropriate response as correct so that it benefits future readers.

Regards
Ankur

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

Chandu Telu
Tera Guru
Tera Guru

Hi,

May I know why you used the client callable script include , You can use the direct script include for this

If you create this script include for only this functionality, you can inactivate this and create a new one??

 

Thanks
Chandu Telu
Please Mark Correct/helpful, if applicable,