I want to hide interaction table (whole module of interaction) based on the groups.

PriyanshiVerma1
Tera Contributor

We have interaction table and it's module. In the Interaction application menu interaction_agent and admin role is added. so the persons are having these role will be able to see the interaction table.

 

My requirement is that I want make it available for the users who are member of XYZ group. If they are not a member of XYZ group and having intercation_agent role stiil they should not be able to access interaction table.

 

So I want make it strictly available only for the members of XYZ group.

 

PriyanshiVerma1_0-1750952728247.png

 

1 ACCEPTED SOLUTION

Aniket Chavan
Tera Sage
Tera Sage

Hello @PriyanshiVerma1 ,

 

What you're asking is doable, but just wanted to say upfront that what @Ankur Bawiskar suggested (creating a custom role and assigning it to your group) is actually the cleanest and most ServiceNow-friendly way to go about it. It’s quick, easy to maintain, and follows best practices.

 

That said, if you're not comfortable going with the custom role route, or you have a specific reason to stick with group-only control — there is another way you can try using a Business Rule on the module.

 

I came across a similar use case in a community discussion a while back, and here's the gist of how it works:

  1. Go to the sys_app_module or sys_app_application table

  2. Create a "Before" Query Business Rule

  3. Use this kind of logic:

if (!gs.getUser().isMemberOf('XYZ') && !gs.hasRole('admin')) {
    current.addQuery('sys_id', '!=', 'your_module_sys_id_here');
}​

👉 Just replace 'XYZ' with your actual group name, and make sure to plug in the sys_id of the Interaction module you're trying to hide.

 

What this does is basically filter out the module from the left nav for anyone who isn’t in that group (or admin), even if they have the interaction_agent role.

 

📌 Here’s the original post I found helpful on this — Hide Application or Module Based on Group.

 

It’s a bit of a workaround, but it should get the job done if the role-based way doesn’t fit your case.

 

Let me know how this works for you.

 

🔹 Please mark Correct if this solves your query, and 👍 Helpful if you found the response valuable.

 

Best regards,
Aniket Chavan
🏆 ServiceNow MVP 2025 | 🌟 ServiceNow Rising Star 2024

View solution in original post

11 REPLIES 11

Hi Ankur,

 

We can not create custom role. Is there any other way to achieve it?

 

@PriyanshiVerma1 

you can use query business rule on application menu table

this link has approach for module, just enhance it for application menu table

hide module using business rule 

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

Aniket Chavan
Tera Sage
Tera Sage

Hello @PriyanshiVerma1 ,

 

What you're asking is doable, but just wanted to say upfront that what @Ankur Bawiskar suggested (creating a custom role and assigning it to your group) is actually the cleanest and most ServiceNow-friendly way to go about it. It’s quick, easy to maintain, and follows best practices.

 

That said, if you're not comfortable going with the custom role route, or you have a specific reason to stick with group-only control — there is another way you can try using a Business Rule on the module.

 

I came across a similar use case in a community discussion a while back, and here's the gist of how it works:

  1. Go to the sys_app_module or sys_app_application table

  2. Create a "Before" Query Business Rule

  3. Use this kind of logic:

if (!gs.getUser().isMemberOf('XYZ') && !gs.hasRole('admin')) {
    current.addQuery('sys_id', '!=', 'your_module_sys_id_here');
}​

👉 Just replace 'XYZ' with your actual group name, and make sure to plug in the sys_id of the Interaction module you're trying to hide.

 

What this does is basically filter out the module from the left nav for anyone who isn’t in that group (or admin), even if they have the interaction_agent role.

 

📌 Here’s the original post I found helpful on this — Hide Application or Module Based on Group.

 

It’s a bit of a workaround, but it should get the job done if the role-based way doesn’t fit your case.

 

Let me know how this works for you.

 

🔹 Please mark Correct if this solves your query, and 👍 Helpful if you found the response valuable.

 

Best regards,
Aniket Chavan
🏆 ServiceNow MVP 2025 | 🌟 ServiceNow Rising Star 2024

Thanks @Aniket Chavan ,

 

It is working.

 

Great to hear that @priyanshive !

 

If it worked for you, could you please mark my response as the accepted solution?
Thanks!😊