From e715e902b444d9cf95076a1ef060a8eb0b9dc626 Mon Sep 17 00:00:00 2001 From: SrijanPatwa <148682493+SrijanPatwa@users.noreply.github.com> Date: Wed, 1 Oct 2025 09:51:45 +0530 Subject: [PATCH 1/4] Create GetMRVSNameAndValue.js Script to retrieve the Multi Row variable set(MRVS) name and value --- Background Scripts/GetMRVSNameAndValue.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Background Scripts/GetMRVSNameAndValue.js diff --git a/Background Scripts/GetMRVSNameAndValue.js b/Background Scripts/GetMRVSNameAndValue.js new file mode 100644 index 0000000000..e301e2481e --- /dev/null +++ b/Background Scripts/GetMRVSNameAndValue.js @@ -0,0 +1,20 @@ +var getVariables = new GlideRecord('sc_req_item'); +if (getVariables.get("")) { + + // 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); + } + } + } +} From 66c63995c1cbb026c5dc2bcff2dfd1e40a297fa5 Mon Sep 17 00:00:00 2001 From: SrijanPatwa <148682493+SrijanPatwa@users.noreply.github.com> Date: Wed, 1 Oct 2025 10:39:10 +0530 Subject: [PATCH 2/4] RetrieveMRVSNameAndValue.js Script to retrieve the Multi Row variable set(MRVS) name and value --- .../RetrieveMRVSNameAndValue.js | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Background Scripts/Retrieve MRVS Name and Value/RetrieveMRVSNameAndValue.js diff --git a/Background Scripts/Retrieve MRVS Name and Value/RetrieveMRVSNameAndValue.js b/Background Scripts/Retrieve MRVS Name and Value/RetrieveMRVSNameAndValue.js new file mode 100644 index 0000000000..e301e2481e --- /dev/null +++ b/Background Scripts/Retrieve MRVS Name and Value/RetrieveMRVSNameAndValue.js @@ -0,0 +1,20 @@ +var getVariables = new GlideRecord('sc_req_item'); +if (getVariables.get("")) { + + // 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); + } + } + } +} From 0f899c2c1ae7da28df6f457ddd31ba97bc9150fd Mon Sep 17 00:00:00 2001 From: SrijanPatwa <148682493+SrijanPatwa@users.noreply.github.com> Date: Wed, 1 Oct 2025 10:49:32 +0530 Subject: [PATCH 3/4] readme.md --- .../Retrieve MRVS Name and Value/readme.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Background Scripts/Retrieve MRVS Name and Value/readme.md diff --git a/Background Scripts/Retrieve MRVS Name and Value/readme.md b/Background Scripts/Retrieve MRVS Name and Value/readme.md new file mode 100644 index 0000000000..d64796cb9d --- /dev/null +++ b/Background Scripts/Retrieve MRVS Name and Value/readme.md @@ -0,0 +1,11 @@ +This code comes handy to retrieve the name and value of Multi Row Variable Sets(MRVS). + + +Sample: + +image + + +Output: + +image From a200d19709872c5a10999251ede69069d84e46ad Mon Sep 17 00:00:00 2001 From: SrijanPatwa <148682493+SrijanPatwa@users.noreply.github.com> Date: Wed, 1 Oct 2025 10:54:47 +0530 Subject: [PATCH 4/4] readme.md Get Name and corresponding value of MRVS --- Background Scripts/Retrieve MRVS Name and Value/readme.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Background Scripts/Retrieve MRVS Name and Value/readme.md b/Background Scripts/Retrieve MRVS Name and Value/readme.md index d64796cb9d..8a0c2c03be 100644 --- a/Background Scripts/Retrieve MRVS Name and Value/readme.md +++ b/Background Scripts/Retrieve MRVS Name and Value/readme.md @@ -1,4 +1,8 @@ -This code comes handy to retrieve the name and value of Multi Row Variable Sets(MRVS). +Open 'Scripts - Background' and paste the code of 'RetrieveMRVSNameAndValue.js' file in it. +Replace the 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: