Show only REQ approvals on Cloned HRM To-Dos Summary widget

Rocky5
Kilo Sage

Hello Devs,

 

When using ootb 'HRM Todos Summary' widget it shows approvals for all tables like REQs, CHGs, etc.. But, we want to use same widget for one of our custom application and we want to see only REQs approvals on it.

Rocky5_0-1705854019181.png

 

So, I have cloned the widget but couldn't figure out where to update the script so, the cloned widget shows only REQ approvals.

 

Any help on the above is appreciated!

 

Thanks in advance,

Rocky.

 

2 REPLIES 2

Ahana 01
Tera Expert


To modify the cloned 'HRM Todos Summary' widget to show only REQ approvals, you need to modify the server script of the widget. Here are the steps:

1. Open the cloned widget in the Service Portal Widget Editor.
2. Navigate to the Server Script section.
3. In the server script, there should be a function or a GlideRecord query that fetches the approvals. It might be using the 'sysapproval_approver' table or a similar table.
4. You need to modify this query to filter only REQ approvals. You can do this by adding an additional condition to the query. For example, if the table used is 'sysapproval_approver', you can add the following condition:

gr.addQuery('source_table', 'sc_req_item');

This will ensure that only approvals for REQs are fetched.
5. Save the changes and refresh the portal to see the changes.

Please note that the exact code might vary based on the existing code in the widget. The above steps provide a general direction on how to achieve the requirement.


nowKB.com

For a good and optimistic result, and solving ServiceNow-related issues please visit this website.https://nowkb.com/home
Kindly mark correct and helpful if applicable

Divya13
Tera Contributor

Hi I also got similar kind of requirement . Can you please let me know if you found any solution?