Filter the "Service" Field on Catalog Task

_SnowDeveloper
Tera Contributor

On the Catalog Task form, the Service field shows a list of items from the Technical Services table.
We need to control which services appear in that list based on the group the agent belongs to.
Some service records (for example: x, y, z) should only be visible to agents who are part of a specific group — Technical Agents Group.

How it should work:
If the agent working on the task is in the Technical Agents Group, they should see:
All Technical Services, including x, y, z

If the agent is not in that group, they should see:
Only the non-restricted Technical Services
They should not see x, y, or z

6 REPLIES 6

Sharique Azim
Mega Sage

Hi SnowDeveloper,

You can achieve it by either reference qualifier on the Service field with a custom script include.

Otherwise you can write a query business rule to exclude query for those records like sys id not in those records.

ACL may work but you would need rigorous testing.

Ankur Bawiskar
Tera Patron
Tera Patron

@_SnowDeveloper 

you can use advanced ref qualifier for this

something like this

javascript: var query;
if(gs.getUser().isMemberOf('Group Name'))
query = ''; // show everything;
else
query = 'sys_idNOT INsysId1,sysId2,sysId3'; // give sysIds of those 3 records which you want to exclude;
query;

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@_SnowDeveloper 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@_SnowDeveloper 

Thank you for marking my response as helpful.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader