- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @radha050903 ,
GlideAppVariablePoolQuestionSet is a ServiceNow server-side API used to retrieve and process Service Catalog variables (questions and answers) that are stored in the platform’s variable pool.
It is commonly used when working with records generated from the Service Catalog, including:
sc_req_item (Request Item / RITM)
sc_task
sc_request
Records created via Record Producers
What is a Variable Pool?
In ServiceNow, catalog variables are not stored directly on catalog-related tables such as sc_req_item or sc_task.
Instead, variable data is stored in dedicated tables that collectively form the variable pool, primarily:
sc_item_option
sc_item_option_mtom
These tables store the definition, value, and relationship of variables and link them to the appropriate catalog records.
Role of GlideAppVariablePoolQuestionSet
GlideAppVariablePoolQuestionSet provides a simplified and structured API to access catalog variables without querying the underlying variable pool tables directly.
Using this API, a developer can:
Load all catalog variables associated with a specific record
Iterate through the list of questions
Retrieve important variable attributes, including:
Variable name
Label
Actual value
Display value
This approach improves readability, maintainability, and performance compared to manually querying catalog variable tables.
Example :
var emptyVariables = [];
var readonlyVariables = [];
var keys = [];
var ritmSysId = '9a0239c6c3e762105ea3bb45990131f7';
var set = new GlideappVariablePoolQuestionSet();
set.setRequestID(ritmSysId);
set.load();
var vs = set.getFlatQuestions();
for (var i = 0; i < vs.size(); i++) {
var question = vs.get(i);
var displayValue = question.getDisplayValue().toString();
var label = question.getLabel().toString();
var name = question.getName().toString();
gs.print(
'Variable Name: ' + name +
' | Label: ' + label +
' | Value: ' + displayValue
);
if (!displayValue) {
emptyVariables.push(name);
}
if (question.isReadOnly()) {
readonlyVariables.push(name);
}
keys.push(name);
}
gs.print('Empty Variables: ' + emptyVariables.join(', '));
gs.print('Readonly Variables: ' + readonlyVariables.join(', '));
gs.print('All Variable Names: ' + keys.join(', '));
---------------------------------------------------------------------------------------------------------------------------------
If this helps you then mark it as helpful and accept as solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @radha050903,
the SN Docs found only this:
| GlideappVariablePoolQuestionSet | Packages.com.glideapp.servicecatalog.variables.VariablePoolQuestionSet |
source: Packages Call Removal tool
Unsolicited advice: Instead of asking if there's anyone who knows about something, just go and ask directly what you want to know, the probability of getting it answered is higher ;))
No AI was used in the writing of this post. Pure #GlideFather only
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @radha050903 ,
GlideAppVariablePoolQuestionSet is a ServiceNow server-side API used to retrieve and process Service Catalog variables (questions and answers) that are stored in the platform’s variable pool.
It is commonly used when working with records generated from the Service Catalog, including:
sc_req_item (Request Item / RITM)
sc_task
sc_request
Records created via Record Producers
What is a Variable Pool?
In ServiceNow, catalog variables are not stored directly on catalog-related tables such as sc_req_item or sc_task.
Instead, variable data is stored in dedicated tables that collectively form the variable pool, primarily:
sc_item_option
sc_item_option_mtom
These tables store the definition, value, and relationship of variables and link them to the appropriate catalog records.
Role of GlideAppVariablePoolQuestionSet
GlideAppVariablePoolQuestionSet provides a simplified and structured API to access catalog variables without querying the underlying variable pool tables directly.
Using this API, a developer can:
Load all catalog variables associated with a specific record
Iterate through the list of questions
Retrieve important variable attributes, including:
Variable name
Label
Actual value
Display value
This approach improves readability, maintainability, and performance compared to manually querying catalog variable tables.
Example :
var emptyVariables = [];
var readonlyVariables = [];
var keys = [];
var ritmSysId = '9a0239c6c3e762105ea3bb45990131f7';
var set = new GlideappVariablePoolQuestionSet();
set.setRequestID(ritmSysId);
set.load();
var vs = set.getFlatQuestions();
for (var i = 0; i < vs.size(); i++) {
var question = vs.get(i);
var displayValue = question.getDisplayValue().toString();
var label = question.getLabel().toString();
var name = question.getName().toString();
gs.print(
'Variable Name: ' + name +
' | Label: ' + label +
' | Value: ' + displayValue
);
if (!displayValue) {
emptyVariables.push(name);
}
if (question.isReadOnly()) {
readonlyVariables.push(name);
}
keys.push(name);
}
gs.print('Empty Variables: ' + emptyVariables.join(', '));
gs.print('Readonly Variables: ' + readonlyVariables.join(', '));
gs.print('All Variable Names: ' + keys.join(', '));
---------------------------------------------------------------------------------------------------------------------------------
If this helps you then mark it as helpful and accept as solution.
