Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

Write a View Rule (View Should be visible to Regional Manager)

Anusha Gorige
Tera Contributor

Write a View Rule (View Should be visible to Regional Manager)

1 REPLY 1

Tai Vu
Kilo Patron

Hi @Anusha Gorige 

In the View Rule form, let's check the Advanced checkbox.

The Script box will be displayed, you can use gs object there to verify the current user and then redirect them to the specific view per requirement.

(function overrideView(view, is_list) {
	
	if(gs.hasRole('itil')){
		answer = '<view_name>';
	}

	if(gs.getUser().isMemberOf('<group>')){
		answer = '<view_name>';
	}

})(view, is_list);

Screenshot 2023-11-10 at 16.03.03.png

 

Cheers,

Tai Vu