- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2025 09:25 AM
Hello Folks,
I have a catalog form that has 2 variable sets, first variable set (Requested_for_details) and second variable set (computer details).
In my second variable set a have a reference variable called Computer_name, when the user select that variable, it must only show the computers assigned to the Requested_for user that was selected in the First Variable set (Requested_for_details).
I tried to do get it using reference qualifier javascript: "assigned_to=" + current.variables.requested_for
But it's not populating the computers, probably because it's in another variable set, can I do it using a client script? if yes, could you please give an exemple?
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2025 02:26 AM
the link I shared has working solution
SOLVED: Issue with MRVS multi row variable set accessing the form values
what configuration you did and what debugging did you perform?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2025 09:38 AM
It should populate, since it's still one of the variables in the form.
Just add variable attribute
ref_qual_elememts = requested_for
In your computer name reference fields since it's dynamically depending on other reference variable.
Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket.
Regards,
Shivalika
My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194
My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2025 09:40 AM
Hi @rafaelalves4337 ,
it should work if both the variable sets are single-row variable sets
if the "computer details" is a MVRS you can follow the scenario 2 approach in the below blog
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2025 12:06 AM
Hi @rafaelalves4337 ,
Like suggested in this above post you can create a onload catalog client script on the MVRS variable set
Script Include
var refQualUtils = Class.create();
refQualUtils.prototype = Object.extendsObject(AbstractAjaxProcessor, {
setSessionData: function() {
var catItemVarName = this.getParameter('sysparm_cat_item_var_name');
var catItemVarValue = this.getParameter('sysparm_cat_item_var_value');
var session = gs.getSession().putClientData(catItemVarName, catItemVarValue);
return;
},
type: 'refQualUtils'
});
OnLoad Client Script (create on MVRS)
function onLoad() {
var catItemVarName = 'v_manager'; //catalog item variable name
var catItemVarValue = g_service_catalog.parent.getValue('requested_for' /* replace with your variableName*/ );
var ga = new GlideAjax('refQualUtils'); //client callable script include name
ga.addParam('sysparm_name', 'setSessionData'); //function in script include
ga.addParam('sysparm_cat_item_var_name', 'requested_for');
ga.addParam('sysparm_cat_item_var_value', catItemVarValue);
ga.getXMLAnswer(function() {});
}
and update the ref qual of the variable on mvrs with
javascript:'assigned_to=' + session.getClientData('requested_for');
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2025 09:42 AM