Using Member of condition for a UI action how can i assign multiple groups

kumar_a
Kilo Explorer

I am trying to restrict the Ui action button only to certain groups

gs.getUser().isMemberOf('group1'&&'group2') this doesn't work

1 ACCEPTED SOLUTION

Community Alums
Not applicable

try gs.getUser().isMemberOf('group1') && gs.getUser().isMemberOf('group2')



Do you really want AND here, or do you want OR?


View solution in original post

6 REPLIES 6

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Kumar,



Can you please refer the below demo where it is working fine. On your instance make sure that the group display name is passed properly.


You can run the same from Background script and see if it gives your true or false.


https://demo007.service-now.com/login.do


Username : admin


Password : admin


Steps for testing : Group button on incident table.


Screen Shot 2015-09-03 at 12.34.39 AM.JPG


kumar_a
Kilo Explorer

The AND condition worked