- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 04-01-2021 08:53 AM
As I recently uploaded my first project to the Share, it feels like a good time for another first, a short article about the project itself. The requirement came about whilst working on a custom Service Portal application for which I wanted to provide users with access to their notification preferences specifically relating to that application.
As per this article from Support (aka HI) KB0688338, notification preferences are not catered for OOB within Service Portal, so a custom widget was required.
Referenced in that KB is a widget created by David Scroggins (which can be found here Article and here Share) which replicates the full platform functionality within the Service Portal. However, I wanted a slightly more targeted solution, so taking inspiration from this widget, I created the Notification Preferences by Category project.
The project consists of two widgets which give the user the ability to toggle notifications for a specified category on/off for their various notification channels without having to navigate away from a Service Portal page.
The ‘Notification Preferences Button’ widget can be placed directly onto a Service Portal page as per below:
When clicked, a modal is displayed with the ‘Notification Preferences by Category’ widget embedded within it:
The latter of the two widgets can also be embedded directly into a parent widget passing in options detailed in it’s client controller.
There are also a number of configuration options which offer a degree of flexibility:
Some of these options are relatively self-explanatory, see below for some detail on the others:
- ‘Exclude List’: This is a list field (against the sysevent_email_action table) which can be used to define any notifications within the specified category that you do not want to be included.
- The three ‘Exclude…’ checkboxes determine if any of the three mobile apps are to be excluded, i.e. you may wish to exclude the ServiceNow Classic app.
- ‘Footer Button Redirect URL’: This is the URL that the user will be redirected to when they click the optional footer button. If left blank, it defaults to the Notification Preferences UI Page within the platform giving the user easy access to the full platform functionality. Alternatively, if you are using David Scroggins’ widget, you could redirect them to a page containing that, thus keeping them within the Service Portal.
- ‘Close Others’: This relates to the functionality of the Bootstrap Accordion element. When checked, only one notification panel can be open at one time.
The project can be downloaded from the Share, hopefully it will prove useful to some.
Thanks for reading,
Jason
- 1,719 Views