logo

NJP

Filtering within the Service Portal

Import · Oct 20, 2020 · article

So this is my first share project, and I will be using this article to further explain the why's and how's for the project.

Link

Why

We started using the CSM module, and the page used "csm_my_lists" is using a script which is read only. So you have no ability to change the "filters" as needed. Hence came the idea to use the filtering already provided by ServiceNow.

The filters shown are based on how you save the filter (visible to:)

  • Me = Personal Filters
  • Everyone = Global Filters
  • Group = Group Filter

How to use

  1. Simply create a new filter for example within the incident table, save this filter (me, group, public)
    image
    Be sure to create "unique" names else the selection will highlight both of the selected filters.
  2. Create a menu link to the page (for example: /sp?id=filtered_data_table&table=incident)
    image
  3. The saved filter will now appear on the page for the service portal users, based on the table used.

Example

This is the OOTB csm_my_lists

image

This is the version I've created with the page: filtered_data_table

imageAnd you can even change the titles (Global/Group/Personal)

image

Now you can use the flexibility the filtering system ServiceNow offers to change it as needed.

Styling

You can change the page properties and CSS to fit your specific needs.Example, fluid layout with table styling.

image

Tips

Making a filter selected by default

Select the filter you want as a starting point copy the url, and change the current menu link with a selected filter:

Example: "/sp?id=filtered_data_table&table=incident&view=ess&sel=active_for_me"

Making only a certain public filter available

Simply add a new field within the filter table for instance a field called "Show on portal", select the filter you do like to share. Adjust the widget options encoded query with this new field: "u_show_on_portal=true";

Questions

Let me know if you have any questions!

Labels:

image

View original source

https://www.servicenow.com/community/developer-articles/filtering-within-the-service-portal/ta-p/2320696