- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2017 05:20 AM
Hi,
I have 2 variables on the catalog form. Both are of reference type.
Oss form to be modified variable is reference of "sc_cat_item" table.
Please identify the collection list variable is reference of question table.
Now when user select the catalog form from the 'oss form to be modified' variable, then 'please identify the collection list' variable should should fetch only the List collector related variables.
Here I am able to filter as shown in screenshot, But issue is I need to restrict the list collector variables to pop-up only from the related form that user selected in "Oss form to be modified" variable.
please let me know, anyone can provide solution for this.
Thank you.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2017 05:44 AM
Hi Harish,
First Use Variables table instead of Question table.
secondly ,If you want your 2nd variable to db dependent on the 1st one...then use Advance Qualifying condition.
Select Advance in Use reference Qualifier
and specify the condition like,
javascript:'type=21^cat_item=' + current.variables.<oss-variable-name>.
Thanks,
Mani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2017 05:37 AM
Hi Harish,
This won't work directly.
My assumption is as follows what you require.
if user selects catalog item A then in the second variable all the variables of type as list collector belonging to the catalog item A should be shown
Also your second field is a reference to table 'item_option_new' i.e. Variables.
you need to use advance ref qualifier and call script include as follows
javascript: new filterVariables().getVariable(current.variables.<oss_field>);
script include
function getVariable(catalogItemSysId){
var encodedQuery = 'typeIN21^cat_item=' + catalogItemSysId;
var arr = [];
var gr = new GlideRecord('');
gr.addEncodedQuery(encodedQuery);
gr.query();
while(gr.next()){
arr.push(gr.sys_id.toString());
}
return 'sys_idIN' + arr;
}
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2017 05:44 AM
Hi Harish,
First Use Variables table instead of Question table.
secondly ,If you want your 2nd variable to db dependent on the 1st one...then use Advance Qualifying condition.
Select Advance in Use reference Qualifier
and specify the condition like,
javascript:'type=21^cat_item=' + current.variables.<oss-variable-name>.
Thanks,
Mani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2017 06:55 AM
Hi Ankur and Maniraj,
Thank you for the Help, Both of your solutions are working good.
But there is only one choice to select correct answer
Thanks