Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to set specific list views for specific Groups

Shawn Horley
Kilo Guru

Greetings folks.

So, I've created specific Groups for the people about to access our new Asset Management application. I've created one of the two Views that I'm going to need. Now I'm trying to figure out how to restrict those group members to seeing the view I've created for them.

CHeers

A.

1 ACCEPTED SOLUTION

Yes. Do this

 

 

(function overrideView(view, is_list) {

if(gs.getUser().isMemberOf('<Your group name 1>') || gs.getUser().isMemberOf('<Your group name 2>')) {
answer = "Admin";
} else if(gs.getUser().isMemberOf('<Your group name 3>'){
answer = "Technicians";
} else {
answer = "default";
}
// set the new view to answer

})(view, is_list);

Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

11 REPLIES 11

Mr. Sanjiv

YOU

ARE

AWESOME!

 

Many Thanks!

 

A.

Hi Sanjiv,

I've similar kind of requirement where I need to show the new view for specific group people so what type of script you prefer here.

 

Thanks

Ram