- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-07-2025 10:29 PM
Hello Team,
I am trying to extract content users have input in the additional column of a catalog item into a report. Please note the variable is HTML type and its not mapped to any field
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-07-2025 10:54 PM
@Community Alums If you're just exploring values, run this in Background Scripts to verify.
var gr = new GlideRecord('sc_req_item');
gr.query();
while (gr.next()) {
var htmlVar = gr.variables.additional_info; // Replace with your variable name
if (htmlVar) {
gs.print('Requested Item: ' + gr.number + ' | HTML Content: ' + htmlVar.toString());
}
}
OR you can create REPORT on a variable via the sc_item_option_mtom table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-07-2025 10:50 PM
@Community Alums
whenever RITM is submitted data for the variables is stored in Variable Ownership table [sc_item_option_mtom] and Options[sc_item_option]
But remember it will store the data in plain text and since your variable is HTML type, it will store in plain text itself
something like this
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-07-2025 10:54 PM
@Community Alums If you're just exploring values, run this in Background Scripts to verify.
var gr = new GlideRecord('sc_req_item');
gr.query();
while (gr.next()) {
var htmlVar = gr.variables.additional_info; // Replace with your variable name
if (htmlVar) {
gs.print('Requested Item: ' + gr.number + ' | HTML Content: ' + htmlVar.toString());
}
}
OR you can create REPORT on a variable via the sc_item_option_mtom table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-07-2025 11:16 PM
Thank you Nilesh. How do i direct it to a specific catalog item, i want it to extract the information from
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-07-2025 11:37 PM
@Community Alums here is code for directing it to a specific catalog item
var catItemSysId = '1234567890abcdef1234567890abcdef'; //catalog item's sys_id
var reqItemGR = new GlideRecord('sc_req_item');
reqItemGR.addQuery('cat_item', catItemSysId);
reqItemGR.query();
while (reqItemGR.next()) {
var htmlInput = reqItemGR.variables.additional_info; // Replace with your variable name
if (htmlInput) {
gs.print('REQ# ' + reqItemGR.number + ' | Input: ' + htmlInput.toString());
}
}