Thank you for your feedback.
Form temporarily unavailable. Please try again or contact docfeedback@servicenow.com to submit your comments.
Versions
  • London
  • Kingston
  • Jakarta
  • Istanbul
  • Helsinki
  • Geneva
  • Store
Close

Service Catalog variable editors

Service Catalog variable editors

Variable editors display variable values in fulfiller forms. A requester specifies these variable values in the catalog item questions.

Types of variable editors based on the catalog item type:

  • For a catalog item, the VEditor displays the values of questions in the requested item and catalog task forms.
  • For a record producer, the default variable editor displays the values of questions for records generated from a record producer for task-extended tables.

VEditor

The VEditor is applicable only for the ordered catalog items. This editor is a formatter added on requested items and catalog tasks of an ordered catalog item. This editor displays the values of questions specified while ordering the catalog item.

By default, the VEditor is applicable for requested items and catalog tasks. You cannot use it for any other table.

To support a catalog UI policy or a catalog client script on the VEditor for requested items and catalog tasks, select the Applies on Requested Items and Applies on Catalog Tasks check boxes for the catalog UI policy or the catalog client script.
Note: The values in the VEditor are displayed from the Options [sc_item_option] table.
To make the VEditor read-only in Platform, activate the onLoad client script, Variable Editor Readonly, for the following tables:
  • Requested Item [sc_req_item]
  • Catalog Task [sc_task]
Note: You can make the Variable Editor Readonly scripts conditional by adding conditions to them.
To make the VEditor read-only in Service Portal, navigate to Service Portal > Portals, select Service Portal, and specify the following code in the Quick start config field.
"readonly_variable_editor": "true"
Figure 1. VEditor
Screenshot for VEditor

Default variable editor

The default variable editor is applicable only for record producers. This editor is a formatter added on records that are generated by a record producer for task-extended tables. This editor displays the values of questions specified in the record producer.

By default, this editor is applicable for the Incident, Problem, and Change tables. For other tables, configure this editor.

Catalog UI policies, catalog client scripts, catalog data lookups, reference qualifiers, and dependent reference fields are supported on the default variable editor only for task-extended tables. To support a catalog UI policy or a catalog client script on this editor, select the Applies on the Target Record check box for the catalog UI policy or the catalog client script.
Note: The values in the default variable editor are displayed in the Question Answer [question_answer] table.
To make this editor read-only, create an onLoad client script on the task extension and add the following code:
function onLoad() { 
$("variable_map").querySelectorAll("item").forEach(function(item){
var variable = item.getAttribute("qname"); 
g_form.setReadOnly("variables."+ variable, true); 
}); 
}
Figure 2. Default variable editor
Screenshot for the default variable editor