Want to show RITM variable in the sysapproval_approver .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2025 03:59 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2025 04:03 AM
Hi Neethu,
Do you mean all variables to be shown in the field? Is there any specific need for it? Also, what have you tried would you mind sharing for a quick review.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2025 04:07 AM
ys i want to display all variable in this feild as :
question1: value1
question2: value2
.
.
.
etc
i want to show this variable data with to the approver .
i just created a feild u_description in the sysapproval_approver table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2025 04:07 AM
why to store it in separate field when you can see it by expanding the Summary here?
The approver can also view the RITM
if you still require then you can use before insert BR on sysapprroval_approver table with this
Condition: current.source_table == 'sc_req_item'
Script:
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var arr = [];
var ritm = new GlideRecord('sc_req_item');
ritm.get('sys_id', current.sysapproval);
var variables = ritm.variables.getElements();
for (var i = 0; i < variables.length; i++) {
var question = variables[i].getQuestion();
var label = question.getLabel();
var value = question.getDisplayValue();
if (label != '') {
arr.push(' ' + label + " = " + value + "\n");
}
}
current.u_descriptio = 'Variable Summary\n' + arr.toString();
})(current, previous);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2025 04:11 AM
@Ankur Bawiskar
Not working,
can we use sc_item_option_mtom table ?
By using above code still the description feild is empty