File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed
Server-Side Components/Background Scripts/Retrieve MRVS Name and Value Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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+
You can’t perform that action at this time.
0 commit comments