To display values from custom fields created on the catalog item table, follow the steps in this article to modify the SC Catalog Item widget in Service Portal.
Instructions
1. Clone the default SC Catalog Item widget.
2. In the server script of the cloned widget, after line 65, add the following:
var catTest = $sp.getParameter('sys_id'); // to get the sys_id of the catalog item from Portal URL
var gp = new GlideRecord('sc_cat_item');
gp.addQuery('sys_id',catTest);
gp.query()
while(gp.next()) {
data.stest = gp.getValue('u_stesting');
}
In this example, u_stesting is a custom string type field created on the catalog item (sc_cat_item) table that needs to be displayed in Service Portal
3. In the Body HTML template of the widget. after the short description section
<div class="text-muted sc-cat-item-short-description" ng-if="::data.sc_cat_item.short_description">{{::data.sc_cat_item.short_description}}</div>
add the following:
<p>Test {{::data.stest}} </p>
4. Use the cloned version of the widget in sc_cat_item or any custom page used in Service Portal used to display the catalog item.
Release
Applies to any supported release