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

Hi @Johns Marokky 

 

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

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 ? -- yes based on provider i need to display account but a time it's supporting only 1 provider

Hi @Emp 53 ,

Please change your script include to the below code. I think it might work.

 

Info: function(provider,provider_1) {

var list = [];

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

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

}

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

 

Modify the script include and see if it works.

If not we might need to drill down the type of fields available in the "u_account" table and the ones you are using as the variables.

 

Mark Helpful and accept the solution if it helps in Solving your query.

 

Regards,

Johns

 

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