- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2023 08:30 PM
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(',');
},
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2023 09:54 AM
@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
Bharath Chintala
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2023 01:13 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2023 07:03 AM
Hi @Sai Kumar B
if i pass the 2 arguments also not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2023 10:10 AM - edited 02-11-2023 10:10 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2023 02:21 AM
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