- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 03:53 AM
I have a requirement that I have use script in sysparm_query in Attachment API. But It is not working as expected(means not returning the correct results).
The script include used. In background script it is working fine
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2024 01:04 AM
As for other people , I want to share this:
Using Javascript in sysparm_query is possible if your script include is client callable and have same function name as the script include.
You can use javascript as follows:
Results of query:
For more information checkout this product documentation regarding scripted Filters :
https://docs.servicenow.com/bundle/washingtondc-platform-user-interface/page/use/using-lists/task/t_...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 05:21 AM
You can't pass the JavaScript this way. Instead create a database view and add your filter condition in the database view. You can call the database view from API.
Otherwise, create a Scripted Rest API and add all your filter within the script.
Thank you,
Palani
Palani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2024 01:04 AM
As for other people , I want to share this:
Using Javascript in sysparm_query is possible if your script include is client callable and have same function name as the script include.
You can use javascript as follows:
Results of query:
For more information checkout this product documentation regarding scripted Filters :
https://docs.servicenow.com/bundle/washingtondc-platform-user-interface/page/use/using-lists/task/t_...