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 auto populate group name on the basis of 2 fields value

Pratiksha Lang1
Kilo Sage

How to auto populate group name on the basis of 2 fields value - Role and Site using Script include.

I want group name to be auto populated on the change of role value and site value. Group field is referring to a group table here.

 

PratikshaLang1_0-1706625212477.png

 

I wrote a script include but not able to figure out how to proceed on this :

 script include :

 

var smdrsRoleMatrix = Class.create();
smdrsRoleMatrix.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {


    getRoleSite: function() {
        var getRole = this.getParameter('sysparm_role');
        var getSite = this.getParameter('sysparm_site');
        var roleMatrix = new GlideRecord("x_amspi_smdrs_app_role_matrix");
        roleMatrix.addQuery('site', getSite);
        roleMatrix.addQuery('role', getRole);
        roleMatrix.query();
        while (roleMatrix.next()) {
            var usrGroup = new GlideRecord('sys_user_group');
            usrGroup.addQuery()
        }
    },

    type: 'smdrsRoleMatrix'
});

 

 

1 REPLY 1

SarthakShri21
Tera Contributor

@Pratiksha Lang1  can you please paste your client script as well here?