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 do we call isMemberOf() from clientside?

nthumma
Giga Guru

Any idea how to call isMemberOf() from client side (onLoad) or any alternatives ?

1 ACCEPTED SOLUTION

shloke04
Kilo Patron

Hi,



You can write a Display Business Rule on the required table and store the value in Scratchpad variable as mentioned below:



g_scratchpad.grp = gs.getUser().isMemberOf('');                   //Mention the name of the Group you want to check



Based on this scratchpad value you can check on the client side as required:



if(g_scratchpad.grp =='true')


{


......Write your validations here as required


}



Hope this helps.Mark the answer as correct/helpful based on impact.



Regards,


Shloke


Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

View solution in original post

9 REPLIES 9

HI Sholke

How can we do it for a catalog item. Like I have a catalog item and there is a field which I want to be read only for all other users and be allowed to change if the user is a member of a particular group

samrat
Tera Contributor

how to do on onchange ?

 

samrat
Tera Contributor

how to do on onchange ?

 

Deepa Srivastav
Kilo Sage

Hi,



You can also use it in script include and call that script include in client script using glide Ajax..


http://wiki.servicenow.com/index.php?title=GlideAjax#gsc.tab=0


http://wiki.servicenow.com/index.php?title=Script_Includes#gsc.tab=0



Mark Correct if it solved your issue or hit Like and Helpful if you find my response worthy.


I think what you are suggesting is what i am looking for. I have a variable (from variable set) on a service catalog that should be visible only to a group's members. The link above does not work anymore. Do you have any more details?