Client Script to get users of a group

jewellauber
Tera Expert

I have a request to conditionally grant read/write access to users if they are apart of a specific group.  Right now I'm trying to figure out how to retrieve this information through client script.  I've been going through lots of articles to learn how to write this client script.  I have the addInfoMessage to attempt to see what is being retrieved and how it looks.

 

function onLoad() {
   //Type appropriate comment here, and begin script below
   
  var ga = new GlideAjax('global.getUserGroups');
    ga.addParam('sysparm_name', 'getUserGroupListRQ');
    ga.addParam('sysparm_grp_arr', g_form.getValue("group"));
    ga.getXML(function(response) {
        var result = response.responseXML.documentElement.getAttribute('answer');
        g_form.addInfoMessage(result);
       
    });  


}
5 REPLIES 5

I just realized that my comprehension of the script includes were all wrong.  My apologies as I am entry level to scripting.  I will double check my script include to see what exactly is being returned and if I can even use the script include for what I am trying to accomplish.