How to Filter Employee Center Announcements Based on Approval Status?

vjanaga1
Tera Contributor

Hello Community,

I am working on a requirement in ServiceNow Employee Center to display only approved announcements in the Announcements widget.

I have investigated the existing configuration and found the following:

  • The Employee Center portal uses the ec_dashboard homepage.

  • The homepage contains a BPT Announcements widget instance.

  • The instance uses the OOTB Announcements widget.

  • The widget's Client Controller retrieves announcements using spAnnouncement.get() and applies the type filter using spAnnouncement.filterOnType().

  • The Server Script only initializes widget options and does not contain the announcement retrieval logic.

  • I also checked the widget dependencies but could not locate the implementation of the spAnnouncement service.

My questions:

  1. How can I identify where the spAnnouncement Angular service is implemented?

  2. What is the recommended approach to filter announcements based on their approval status?

  3. Can this requirement be achieved through widget configuration or should we clone and customize the OOTB Announcements widget?

  4. What is the safest approach to ensure that only approved announcements are displayed without impacting existing functionality?

Any guidance, documentation, or examples would be greatly appreciated.

Thank you!

2 REPLIES 2

sandeepdutt
Tera Patron

Hi @vjanaga1 ,

Unfortunately, there is no OOTB Approval workflow for Announcements.

 

ChrisBurks
Giga Sage

Hi @vjanaga1 ,

 

  1. How can I identify where the spAnnouncement Angular service is implemented?

    1. Angular Services are usually found under "Angular Providers" in the related list of a widget. However, in this case ServiceNow may not want non-ServiceNow employees to have access because "spAnnouncement" is not listed in the Angular Providers list even though it is being injected into the controller. 
      Navigate to All > Service Portal > Angular Providers to see the list of OOTB Angular Services/Factories/Directives
  2. What is the recommended approach to filter announcements based on their approval status?

    1. OOTB the announcements don't have an approval workflow associated with them. However, one way to filter or control whether or not an announcement displays is by embedding the OOTB widget inside a custom widget. This way the OOTB functionality stays intact and you have control over the rendering 
  3. Can this requirement be achieved through widget configuration or should we clone and customize the OOTB Announcements widget?

    1. Same as reply for #2 question
  4. What is the safest approach to ensure that only approved announcements are displayed without impacting existing functionality?

    1. If you've created a custom approval for the Announcements feature then the safest approach would be to use a fully custom widget or a custom widget that embeds the OOTB widget. Have your custom widget contain the logic for rendering the OOTB widget tied to your approval status