
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Catalog Variables are stored in a table item_option_new.
The variables are associated either to a catalog item or to a variable set.
The association between catalog item and variable set is stored in io_set_item.
Create a Database view on the two tables like this
Expose the following fields in each table
Table: item_option_new
Table: io_set_item
Note the whereclause.
Try the database view and have the following filter and list layout. (Note: The two Catalog Item comes from the different tables in the view)
Note: Multi Row Variable Set Values cant be achieved by this method
Another solution is to get it via query. Here is a simple query to do the same.
var gr = new GlideRecord('sc_req_item');
if (gr.get('635a1f5387320300e0ef0cf888cb0b73')) {
var variables = gr.variables.getElements();
for (var i=0;i<variables.length;i++) {
var question = variables[i].getQuestion();
gs.log(question.getLabel() + ":" + question.getValue())
}
}
From New York to get values of table variable
var gr = new GlideRecord('sc_req_item');
gr.get('02c38dcd87013300e0ef0cf888cb0bb2');
var vars = gr.variables.getElements(true); //Get Table Variables as well
for (var i=0; i<vars.length; i++) {
var v = vars[i];
if (v.isMultiRow()) {
var rows = v.getRows();
for (var j=0; j<v.getRowCount(); j++) {
var row = rows[j];
var cells = row.getCells();
for (var k=0; k<cells.length; k++) {
var cell = cells[k];
gs.info(cell.getLabel() + ":" + cell.getCellDisplayValue())
}
}
}
}
- 16,893 Views
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.