Skip to content

Commit 76ba1c9

Browse files
authored
Retrieve MRVS Name and Value (#1652)
* RetrieveMRVSNameAndValue.js Access the name and corresponding value of MRVS * readme.md
1 parent be1fd1a commit 76ba1c9

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//GlideRecord to the RITM table to access the name and corresponding value of MRVS
2+
var getVariables = new GlideRecord('sc_req_item');
3+
4+
//Pass the sysId of RITM record
5+
if (getVariables.get("<pass_ritm_sys_id_here>")) {
6+
7+
//<mobile_devices_set> is the internal name of MRVS
8+
var mrvsInternalName = getVariables.variables.mobile_devices_set;
9+
var rowsCount = mrvsInternalName.getRowCount();
10+
11+
if (rowsCount > 0) {
12+
for (var i = 0; i < rowsCount; i++) {
13+
var getRowVal = mrvsInternalName.getRow(i);
14+
var getCellVal = getRowVal.getCells();
15+
16+
for (var j = 0, len = getCellVal.length; j < len; j++) {
17+
var mrvsFieldName = getCellVal[j].getName();
18+
var mrvsFieldValue = getCellVal[j].getCellDisplayValue();
19+
gs.info(mrvsFieldName + ' : ' + mrvsFieldValue);
20+
}
21+
}
22+
}
23+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
This code comes handy to retrieve the name and value of Multi Row Variable Sets(MRVS).
2+
3+
Sample:
4+
RITM is raised with below MRVS details:
5+
6+
<img width="1819" height="290" alt="image" src="https://github.com/user-attachments/assets/b03063c1-a8a5-4128-b19f-d451e80b7388" />
7+
8+
9+
Background Script:
10+
11+
<img width="886" height="515" alt="image" src="https://github.com/user-attachments/assets/2d368b99-88d9-4e2f-9fc9-985b1d68efad" />
12+
13+
Output:
14+
15+
<img width="536" height="194" alt="image" src="https://github.com/user-attachments/assets/43aa8ac8-0799-43cc-a7d6-a80dc28d36a3" />
16+
17+
18+

0 commit comments

Comments
 (0)