access variable inside MRVS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2025 03:18 AM
Hi team,
I have a variable Requested for which is part of the User field variable set, and I have affected for the variable which is part of MRVS now i want to populate the affected for field with all users where manager is equal to requested for.
I tried creating a script include and calling it via ref qualifier but its returning undefined for current.variables.requested_for
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2025 03:34 AM - edited 07-10-2025 03:34 AM
Hello @vandanasaluja
current.variables.requested_for.toString();
Try this please.
Pls mark my solution as accept and thumbs up if you find it helpful. It will help other users on community to find helpful response.
Regards,
Samaksh Wani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2025 03:40 AM
so you want to use outside variable within reference qualifier of MRVS variable?
refer this link and it has solution
SOLVED: Issue with MRVS multi row variable set accessing the form values
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2025 08:26 PM
Hope you are doing good.
Did my reply answer your question?
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2025 05:14 AM
Hello @vandanasaluja,
Please try the onload script in the MRVS. Assuming that the affected user is List collector which stored the list of users with manager as the requested_for in the form. Please find the script below:
function onLoad() {
var v=g_service_catalog.parent.getValue("requested_for");
alert("alert"+v);
var gr=new GlideRecord("sys_user");
gr.addQuery("manager",v);
gr.query();
var a=[];
while(gr.next())
{
a.push(gr.getValue("name"));
}
var a_to_s =a.toString();
g_form.setValue("mrvs_req_for", a);
//Type appropriate comment here, and begin script below
}
Please let me know in case of any query or I need to understand the problem in different way.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Thanks,
Muskan