- 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 06:57 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2023 01:06 AM
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
- 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