Multi Row Variable set values to show on updated catalog item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2025 05:50 PM
Hi All,
I have a requirement where i have to pull the values entered in the multi Row Variable set on another catalog item.
Example: Catalog Item A - Already submitted values into variable set
Example: Catalog Item B - User will enter the RITM in Requested item variable. Once updated it should pull value from RITM0010002, and populate in MRVS - Additional Information.
I tried checking in the community could not find the right solution. Is there a way we could pull the data from
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2025 09:56 PM
Simply use onChange + GlideAjax, get the MRVS JSON from earlier RITM and set it
Something like this, but please enhance
Script Include: It should be client callable
var MRVSHelper = Class.create();
MRVSHelper.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getMRVSValues: function() {
var gr = new GlideRecord("sc_req_item");
gr.addQuery("sys_id", this.getParameter('sysparm_ritmSysId'));
gr.query();
if (gr.next()) {
return gr.mrvsVariableSetName.toString();
}
},
type: 'MRVSHelper'
});
onChange Catalog client script: on RITM variable
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading) {
return;
}
if (newValue === '')
g_form.clearValue('mrvsVariableSetName');
var ga = new GlideAjax('MRVSHelper');
ga.addParam('sysparm_name', 'getMRVSValues');
ga.addParam('sysparm_ritmSysId', newValue);
ga.getXMLAnswer(function(response) {
g_form.setValue('mrvsVariableSetName', response);
});
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader