I would like to know how to get the label question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2023 12:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2023 07:25 AM
Hi @Kotaro Kobayas1 ,
If you're looking for information related to variables associated with a sc_req_item, you can iterate through the variables on the sc_req_item to retrieve information about them. Here's a general script to get started:
var requestItem = current.sysapproval.ref_sc_req_item;
var variables = new GlideRecord('sc_item_option');
variables.addQuery('request_item', requestItem);
variables.query();
while (variables.next()) {
// Access information about the variable
var variableName = variables.variable.name;
var questionText = variables.variable.question_text;
// Use the information as needed
gs.info('Variable Name: ' + variableName);
gs.info('Question Text: ' + questionText);
}
In this script, sc_item_option
is used to retrieve the variables associated with a sc_req_item
. Please note that the table names and field names might differ based on your instance's configuration, so you might need to adapt the script accordingly.
If you still can't get the information you need, consider checking the variable set associated with the sc_req_item
. You can use sc_item_option
and sc_item_option_mtom
tables to traverse the relationships between variable sets and variables.
Thanks,
Ratnakar