Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Background Scripts/GetMRVSNameAndValue.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
var getVariables = new GlideRecord('sc_req_item');
if (getVariables.get("<pass_ritm_sys_id_here>")) {

//<mobile_devices_set> is the internal name of MRVS
var mrvsInternalName = getVariables.variables.mobile_devices_set;
var rowsCount = mrvsInternalName.getRowCount();

if (rowsCount > 0) {
for (var i = 0; i < rowsCount; i++) {
var getRowVal = mrvsInternalName.getRow(i);
var getCellVal = getRowVal.getCells();

for (var j = 0, len = getCellVal.length; j < len; j++) {
var mrvsFieldName = getCellVal[j].getName();
var mrvsFieldValue = getCellVal[j].getCellDisplayValue();
gs.info(mrvsFieldName + ' : ' + mrvsFieldValue);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
var getVariables = new GlideRecord('sc_req_item');
if (getVariables.get("<pass_ritm_sys_id_here>")) {

//<mobile_devices_set> is the internal name of MRVS
var mrvsInternalName = getVariables.variables.mobile_devices_set;
var rowsCount = mrvsInternalName.getRowCount();

if (rowsCount > 0) {
for (var i = 0; i < rowsCount; i++) {
var getRowVal = mrvsInternalName.getRow(i);
var getCellVal = getRowVal.getCells();

for (var j = 0, len = getCellVal.length; j < len; j++) {
var mrvsFieldName = getCellVal[j].getName();
var mrvsFieldValue = getCellVal[j].getCellDisplayValue();
gs.info(mrvsFieldName + ' : ' + mrvsFieldValue);
}
}
}
}
15 changes: 15 additions & 0 deletions Background Scripts/Retrieve MRVS Name and Value/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Open 'Scripts - Background' and paste the code of 'RetrieveMRVSNameAndValue.js' file in it.
Replace the <pass_ritm_sys_id_here> with the RITM sysId of your use case.
Replace the MRVS Internal name as per that RITM's MRVS name

Usage: This code comes handy to retrieve the name and value of Multi Row Variable Sets(MRVS).


Sample:

<img width="702" height="438" alt="image" src="https://github.com/user-attachments/assets/dca9b8bd-0db6-44ad-9c6f-0e2db24c60fc" />


Output:

<img width="422" height="155" alt="image" src="https://github.com/user-attachments/assets/2eb7f5ff-709d-4347-8149-2688bd0d0230" />
Loading