Help needed with list view filters

Snehal13
Kilo Sage

I have a requirement as below

 

1. If user with a custom created role 'X' logins to ServiceNow instance and open incident list view, he must only see incidents of high priority that were created in the past 1 week only

2. All other users must see the default list view

 

How to apply "filters on list view dynamically" based on the role of logged in user.

1 ACCEPTED SOLUTION

Maik Skoddow
Tera Patron
Tera Patron

Hi @Snehal13 

Such requirements are always far too short-sighted. There are always situations where user XY needs to see more than originally thought and then you are at an impasse. 

Use the modules (second and third level navigation level) instead.
Create two modules, each with the same name but different role restrictions (tab "Visibility"). You can then configure the corresponding filter conditions in the "Link Type" tab.

MaikSkoddow_0-1703306107193.png

Maik

View solution in original post

4 REPLIES 4

Maik Skoddow
Tera Patron
Tera Patron

Hi @Snehal13 

Such requirements are always far too short-sighted. There are always situations where user XY needs to see more than originally thought and then you are at an impasse. 

Use the modules (second and third level navigation level) instead.
Create two modules, each with the same name but different role restrictions (tab "Visibility"). You can then configure the corresponding filter conditions in the "Link Type" tab.

MaikSkoddow_0-1703306107193.png

Maik

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Snehal13 

 

You can do by changing the OOTB list module but it is not a good way. As @Maik Skoddow 

- Create 2 different  modules

- Set the visibility as per the roles.

 

or make change in OOTB with user. role in condition.  

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Rajesh_Bhise
Tera Guru

Hello @Snehal13 ,

 

I can suggest you very simple solution on your concern mentioned.

 

*************************************************************************************************************

You can simply create QUERY BR and get the work done in 2 line of code.

Please check how i solve this problem.

1. Created a custom role - Test_role_RB

2. Created Before Query BR as below and used that role for condition.

 

RajeshBhise1_0-1703333341790.png

 

RajeshBhise1_1-1703333483875.png

 

3. Given that role to one ITIL user and impersonated him.

4. When redirected to Incident list view, I got the expected encoded query and result.

  

RajeshBhise1_2-1703333538572.png

Note - As my PDI did not have those records, my list shown as empty but you can try this in your instance where incidents created in last week are present with priority as HIGH.

I have verified by applying other queries and it worked fine.

 

You will surely get the result based on this solution.

*************************************************************************************************************

Hope this find you easy answer of your query.

@Maik Skoddow @Dr Atul G- LNG  - Please correct me here if you have other thoughts.


Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.

Happy to help you in future.

 

Thank you,
Rajesh

 

Hi @Rajesh_Bhise 

 

this is exactly the opposite of what I would recommend. Did you read what I wrote before?

 

"Such requirements are always far too short-sighted. There are always situations where user XY needs to see more than originally thought and then you are at an impasse."

 

Maik