Wybren1
Tera Guru

Filters with a data table within the Service Portal

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)
    find_real_file.png
    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)
    find_real_file.png

  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
find_real_file.png

This is the version I've created with the page: filtered_data_table
find_real_file.png
And you can even change the titles (Global/Group/Personal)
find_real_file.png
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.
find_real_file.png

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!

Comments
Damian Martinez
Mega Sage

Hello,

we are going to deploy our csm portal soon want to use a widget with filtering, we implemented one however when we press the filter icon, the user can even search for cases open for another company, how can we restrict this?
is there any other widget that we can use for column filtering?

Thanks

 

Wybren1
Tera Guru

@Damian Martinez You can probably and hopefully achieve this by ACL's and Before Query rules. Haven't tried this yet. But this is probably the way. So add ACL's and Before Query's on the account/company table.

Version history
Last update:
‎10-20-2020 02:38 PM
Updated by: