how to fetch values from mvrs for variables outside from mrvs in servicenow
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2025 08:02 AM
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2025 08:17 AM
Hi @sariksorte , In your client script -
var mrvs = JSON.parse(g_form.getValue('mrvs')); //name of your mrvs
var rows = mrvs.length;
if (rows > 0) {
for (var i = 0; i < mrvs.length; i++) {
g_form.addInfoMessage(mrvs[i].user); //user is the variable inside mrvs
g_form.addInfoMessage(mrvs[i].req_for); //req_for is the variable inside mrvs
}
}
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2025 08:20 AM
Hi @sariksorte, If it's the other way around, in your client script of MRVS -
var req_for = g_service_catalog.parent.getValue("req_for"); //'req_for' is the variable outside MRVS
g_form.addInfoMessage(req_for);