Reference Qualifier not working for 2 variables

Emp 53
Tera Contributor

Hi All,

i written below script but it's not working as expected in reference qualifier if i call 2 variables in ref condition.

Provider : AWS

Provider_1 : AWS, Azure,VMWare

working condition: javascript: new provider().Info(current.variables.provider);

Condition not worked: 

javascript: new provider().Info(current.variables.provider,current.variables.provider_1);

 

Info: function(provider) {

var list = [];

var gr = new GlideRecord("u_account");
gr.addQuery("u_provider", provider);
gr.query();
while (gr.next()) {

list.push(gr.sys_id.toString());

}

return 'sys_idIN' + list.join(',');
},

1 ACCEPTED SOLUTION

BharathChintala
Mega Sage

@Emp 53  If that variable is referred to u_account table then no need of script include

write this reference qualifier.

javascript:  ‘u_provider=‘+current.variables.provider

if above didn’t work means

if it is record producer write producer. Instead of current

cat item write item. Instead of current

If my inputs have helped with your question, please mark my answer as accepted solution, and give a thumb up.
Bharath Chintala

View solution in original post

7 REPLIES 7

Sai Kumar B
Mega Sage
Mega Sage

Hello @Emp 53 

Can you change your script include function to this? Pass variable 2 argument in function call 

Info: function(provider, provider1) {

var list = [];

var gr = new GlideRecord("u_account");
gr.addQuery("u_provider", provider);
gr.query();
while (gr.next()) {

list.push(gr.sys_id.toString());

}

return 'sys_idIN' + list.join(',');
},

If I could help you with my response you can mark it as helpful and correct as it benefits future viewers
Thanks,
Sai Kumar B
Community Rising Star 2023 & 2022

 

Hi @Sai Kumar B 

if i pass the 2 arguments also not working

@Emp 53 

In the variable 1 and 2 reference qualifiers, try the below
//For variable 2

javascript : new provider().Info(current.variables.provider_1); //Pass only variable2 value

//For variable 1

javascript : new provider().Info(current.variables.provider); //Pass only variable1 value

 

If provider 1 is list collector variable then try the below script include code

 

Info: function(provider) {

var list = [];

var gr = new GlideRecord("u_account");
gr.addEncodedQuery("u_providerIN"+provider);
gr.query();
while (gr.next()) {

list.push(gr.sys_id.toString());

}

return 'sys_idIN' + list.join(',');
},

 

If I could help you with my response you can mark it as helpful and correct as it benefits future viewers
Thanks,
Sai Kumar B
Community Rising Star 2023 & 2022

 

Johns Marokky
Tera Guru

Hi @Emp 53 ,

I have two questions here. What is the field type of provider_1 whether it's a list?

Also, In Provider_1, I can see there are three values. So basically I am assuming that you need to show the values of account of all three providers. Am I right ?

If that's the case then the script needs to be modified. If you could confirm this i could write a script for you and post here.

 

Regards,

Johns