I need to implement the below use case through data filtration

Community Alums
Not applicable

Hi Everyone,

My use case is like..
1) In incident table, there are many records with different assignment groups..
Suppose I am creating a data filtration, that if user is part of Hardware group then only the user can able to see the records whose assignment group is Hardware.
User (
with group hardware)----All assignment group incidents+ Hardware assignment group incidents
User(without group hardware)----All assignment group incidents except hardware assignment group incidents

UTSAVJAISWAL_0-1716494296939.png

 

This use case is working perfectly.

Now, I want to add one more condition

2) In the incident record, I have created a custom field--collaborator (list type).
    Now if, in the collaborator field i have added a user (whose role is sn_collaborate, it is a custom role)
   

UTSAVJAISWAL_1-1716494296834.png

 

So, the use case is like..
If the user which is mentioned in Collaborator field is having the role--"sn_collaborator" then irrespective of user is a part of hardware group, the user can able to see the records in which assignment group is "Hardware" and collaborator is Me.

UTSAVJAISWAL_2-1716494296825.png

 

Here, I have created the 2nd data filtration.

But this 2nd data filtration is not working, maybe because in the 1st data filtration, we are hiding the records(whose assignment group is Hardware) , from the non-Hardware group members.

How can I tackle this use case..

Please let me know, if there is any doubt on the use case..
Thanks in Advance!!
Utsav

2 REPLIES 2

Tony Chatfield1
Kilo Patron

Hi, unfortunately I can't see any clear detail in your screenshots, but for the scenario you described I would normally use a Query Business Rule to build and apply an Encoded Query to filter the tasks that the user(s) can see.

Before Query business rules (servicenow.com)
This article from SN_Nerd is also a good primer
Query Business Rules: A Definitive Guide - ServiceNow Community

 

So that rather than trying to apply multiple different static queries, the QBR applies a dynamic (scripted) reference qualifier type query based on the logged in users relationship to the records involved.

Reference qualifiers (servicenow.com)

I would normally add my code to a script-include function and then call it from the QBR, returning a filter\query string to the QBR.

Community Alums
Not applicable

Hi @Tony Chatfield1 really thankyou for your quick response..
Just one last query, can we implement the above scenario through Data Filtration.

Thanks in Advance
 Utsav