Can we pass two parameters of the script include in the List collector Qualifier

Samiksha2
Mega Sage

Hi,

How we can pass two parameters in the list collector advance qualifier.

Thanks

17 REPLIES 17

Zach Koch
Giga Sage
Giga Sage

This link may help you, as it talks about using variables in a list collector dynamic reference qualifier 

List collector dynamic reference qualifier

If this solved your issue, please mark this correct and helpful, thank you!

If this information helped resolve your issue, please remember to mark response correct and thumbs up to help future community members on this information, thanks!

Pavankumar_1
Mega Patron

Hi @Samiksha ,

can you share business requirement?

 

Thanks,

Pavankumar.

If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

why not?

it will be like this

javascript: new getRoles().getProdRole(parm1,parm2);

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi @Ankur Bawiskar ,

this is my script

 getProdRole: function() {
        var gr;
        var gec = this.getParameter('sysparm_callerSysID');
        var roleName = this.getParameter('sysparm_role_name');
        if (roleName == 'Manager') {
            roleName = 'owned';
        }
        var gec = new GlideRecord('u_product');
        gec.addQuery(roleName, gec);
        gec.query();
        while (gec.next()) {
            //dri.push(gec.name.toString());
            var pri = gec.name.toString();
        }
        return "sys_idIN" + gr.toString();
        //return JSON.stringify(gr);
    },

 

and List collector variable is -

javascript: new getRoles().getProdRole(current.variables.select_the_user, current.variables.select_people_role);

 

How to achieve that. I tried but nothing is coming in the variable.

Pavankumar_1
Mega Patron

Hi,

Please try below script but not sure why you are using getParameter if are created client script and getting these parameters from that . Then it will not work.

Advanced reference qualifier are server side scripting it will not execute if you try from client side scripting.

if my opinion is correct then try to query in the script include and get those parameters.

 

 

getProdRole: function() {
        var gr;
        var pri = [];
        var gec = this.getParameter('sysparm_callerSysID');
        var roleName = this.getParameter('sysparm_role_name');
        if (roleName == 'Manager') {
            roleName = 'owned';
        }
        var gec = new GlideRecord('u_product');
        gec.addQuery(roleName, gec);
        gec.query();
        while (gec.next()) {
            pri = gec.name.toString();
        }
        return "sys_idIN" + pri;

    },

 

Hope you it helps you.

Please Mark ✅ Correct/helpful if applicable, Thanks!! 

 

Regards

Pavankumar

If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar