How can I Apply UI policy on Multiple catalog items
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2020 09:11 PM
Hi,
I have created a Catalog UI policy for variable set in one of the catalog item, now I need to apply the same UI policy to multiple catalog items which is using the same variable set(its a mult-row variable set).
Please advice a script if I can apply the same UI policy to be created or applied to multiple catalog items.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2020 09:58 PM
Hi Namrata,
It doesnt work for multi-row variable set.
Basically I need a script to create UI policy for multiple catalog items
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2020 10:23 PM
Hey Heisenberg,
I have just tried it for multi-row variable set.
and it Works!
Thanks
Namrata.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2020 10:30 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2020 11:38 PM
Hi,
Below script gives you a Name of all variable in variable set
var mrvs;
var itemID = '70506da8db002300e69dfbef2996194a'; //Pass your sys_id of variable set
var ritmGR = new GlideRecord('sc_req_item');
if (ritmGR.get(itemID)) {
mrvs = ritmGR.variables.mrvs_internal_name;; //pass your a backend name of variable in Multi Row Variable Set(internal_name)
}
gs.print(mrvs);
Below script using for loop we iterate each rows and get the display value of each variable.
var current = new GlideRecord('sc_req_item');
current.get('6be98d3edbed7b407eee785e0f961916');
var mrvs = current.variables.mrvs_internal_name;
var totalRows = mrvs.getRowCount();
for (var i = 0; i < totalRows; i++) {
gs.addInfoMessage('Display Value: ' + mrvs.getRow(i).getCell('variable_name').getCellDisplayValue());
}
Exploring The Multi row variable set
https://community.servicenow.com/community?id=community_blog&sys_id=7cc66514db882380e0e80b55ca961965
Scripting the Multi-row variable set
https://community.servicenow.com/community?id=community_blog&sys_id=865b5aeddbc023c0feb1a851ca9619f9
I hope it will give you a way to work on Multi Row Variable Set.
Thanks,
Kunal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2020 10:14 PM
Hi,
Here is the Detail Screenshots of Scenario:
Step1: Go to Catalog UI Policy.
Note:My Variable set name is New.
Step2: My new Catalog item is New Comm.
Go to variable set section of other Catalog item.
Click on Edit.
Search a New Variable set.(New is a name of my variable Set).
Select that variable set by Double clicking on it.
If it works for you,Mark My answer Correct and Helpful.
Thanks,
Namrata.