Get property value in Report filter condition

souravdebna
Tera Contributor

I have a Property where I have a list of sys_ids. In one report I need to add condition like 'sys_id is one of' and in the value I need to provide property value. I tried mulrtiple ways like gs.getProperty(), calling client callable script include function, calling client callable class less function. In all cases it shows undefined.

 

Does anyone know how to achieve this?

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@souravdebna 

it doesn't work. I have tried this multiple times earlier and had raised problem.

The response I had received was the script in report filter conditions run in "sandbox mode" and blocks this

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

Script sandbox property

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

5 REPLIES 5

Mark Manders
Mega Patron

This sounds like a very weird way of creating reports. System properties can only be created/maintained by system admins. So you are constantly asking your admins to change a system property to do nothing else than change the condition on a report that can be changed by anyone with access to that report. Why not just add it to the default report, so users can change it themselves? 

If it is a requirement that does make sense (since we don't have all information, I could be missing something), you can always check on 'dynamic filter options' (link). 'sys id IS DYNAMIC your_scripted_option'.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

souravdebna
Tera Contributor

@Mark Manders  Dynamic filter would have been a good option, But in report condition I do not see IS DYNAMIC operator. I remember I used script include functions in report conditions as well as in list conditions. But now it is not working. Not sure if anything changed in Xanadu or in earlier version. Thank you for your reply, Let me think of other options.

Ankur Bawiskar
Tera Patron
Tera Patron

@souravdebna 

it doesn't work. I have tried this multiple times earlier and had raised problem.

The response I had received was the script in report filter conditions run in "sandbox mode" and blocks this

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

Script sandbox property

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Checking the sandbox checkbox in script include works for me. Thank you for the informaiton