Skip to content

Commit f028493

Browse files
authored
Look up MRVS row index (#816)
* Create readme.md * Create LookUpMrvsRowIndex.js
1 parent 1469c57 commit f028493

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
(function execute(inputs, outputs) {
2+
// Look up the 'Multi Row Question Answers' records associated with a specific sys_id and return the unique 'Row indexes'
3+
var array = [];
4+
5+
var grMrvs = new GlideRecord('sc_multi_row_question_answer');
6+
// Update line below with correct input variable
7+
grMrvs.addQuery('parent_id',inputs.ParentID);
8+
grMrvs.query();
9+
10+
while (grMrvs.next()) {
11+
array.push(grMrvs.row_index.toString());
12+
}
13+
14+
var arrayUtil = new ArrayUtil();
15+
// Update line below with correct output variable
16+
outputs.row_index_array = arrayUtil.unique(array);
17+
18+
})(inputs, outputs);
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## Overview
2+
To be used within an action to retrieve the unique **Row indexes** for each row within a MRVS
3+
4+
## Inputs
5+
Pass in the sys_id of the record the MRVS is associated with. E.g., the sys_id of a RITM record.
6+
7+
## Script Step
8+
Create a script step with the code provided to look up each unique **Row index** associated with the MRVS
9+
10+
## Outputs
11+
Returns an array of strings with each string representing the **Row index**

0 commit comments

Comments
 (0)