Restrict Filters and Breadcrumbs (fixed queries) in Service Portal

Brian Lancaster
Tera Sage

I have used Restricted Filters in the past on menu options like My Approvals.  Is there a way to do something similar in service portal.  Basically we want to use Data Table form Instance Definition on the My Requests page but I don't want them to be able to remove anything from the default filter.  I still need them to be able to add to the filter and be able to remove anything they have added.  Just like in the standard UI.

 

find_real_file.png

1 ACCEPTED SOLUTION

sana11
Kilo Guru

Fixed!!

Guys I tried all possible ways to get a restricted filter for tables in portal, Nothing worked for me.

Finally I fixed it with the help of css.

I just copied selectors of each breadcrumb <a> tag from instance element and written below script in page- css not in widget-css.

.v339a5c41d7201200b0b044580e61030d .breadcrumbs span:nth-child(2) a ,
.v339a5c41d7201200b0b044580e61030d .breadcrumbs span:nth-child(3) a,
.v339a5c41d7201200b0b044580e61030d .breadcrumbs span:nth-child(4) > a.sp-breadcrumb-link.sp-breadcrumb-remove-condition.ng-scope{
pointer-events:none !important;
}

Now its perfect and user can able to access only last filter option in breadcrumb.

find_real_file.png

 

View solution in original post

27 REPLIES 27

maer2704
Tera Contributor

Are you saying is not filtering? 

No I'm saying that it is not affecting "Data Table For Instance definitions" widget and removing the ability to remove the filter I initially set.  When I add that widget you had me edit it just show the breadcrumbs like in my screenshot but there is no data displayed with it and it is also only removing active = true from being removed from the filter.  What I'm trying to do is use a "Data Table For Instance definitions" and have the breadcrumbs for what I set as the query to not be editable.

find_real_file.png

Hi Brian

Did you find a solution on this?

No but I have created an idea for this so hopefully if it gets enough votes it will get implemented.

https://community.servicenow.com/community?id=view_idea&sysparm_idea_id=3e0d6951dbab37c0feb1a851ca96...

sana11
Kilo Guru

Fixed!!

Guys I tried all possible ways to get a restricted filter for tables in portal, Nothing worked for me.

Finally I fixed it with the help of css.

I just copied selectors of each breadcrumb <a> tag from instance element and written below script in page- css not in widget-css.

.v339a5c41d7201200b0b044580e61030d .breadcrumbs span:nth-child(2) a ,
.v339a5c41d7201200b0b044580e61030d .breadcrumbs span:nth-child(3) a,
.v339a5c41d7201200b0b044580e61030d .breadcrumbs span:nth-child(4) > a.sp-breadcrumb-link.sp-breadcrumb-remove-condition.ng-scope{
pointer-events:none !important;
}

Now its perfect and user can able to access only last filter option in breadcrumb.

find_real_file.png