View rule is not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello everyone, I have created a view called "Test view" which have only 4 fields and should be applicable to only list view, and this view should be visible to only users of group "Database". I created this view rule but it is not working? It is visible to all the users irrespective of groups
(function overrideView(view, is_list) {
if (is_list && gs.getUser().isMemberOf('Database')) {
answer = 'test_view';
}
})(view, is_list);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
So database users are navigated to correct list view but they are able to see the other views?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @sunil10,
As far as i know a View Rule by itself will not hide a view.
It only decides which view is automatically selected.
Other users can still see and manually select that view in the dropdown if they have access to the list layout. If you need to hide the view from everyone except your target group, along with view rule ,set the field "Hidden" to true in view that you have created.