Using script in report servicenow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2025 09:01 AM
Hi all !
In the RITM table (sc_req_item), each RITM has an associated "volumetry" field of integer type. I want to create an advanced report that displays the number of RITMs multiplied by the volumetry.
For example, if I have 3 requests with a volumetry of 3 for each, the result I should get should be: (1*3) + (1*3) + (1*3) = 9.
For this, I created a script include and called it in my report as mentioned below, but I get a result equal to 0.
Can someone help me?
Script include :
Report :
thanks in advance !

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2025 11:28 AM
Hi,
You'll need to upload your screenshots as attachments, they've been compressed and aren't readable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2025 04:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2025 06:33 AM
Hello @hind
As per new screenshot shared it has function which is calculating as per your requirement. Now the thing you are doing in report is really out of context as you are trying to filter with SysID and calling script include but that also is wrong as you are just calling name of scriptinclude not the function. Also, if you call the function still your report will give result as zero as you are not returning sysid which will display count of ritm which has volumetry variable.
You can always test your script include by calling in background scripts and see what is return when function is called.
If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.
Thanks & Regards
Viraj Hudlikar.