Variable Types

From ServiceNow Wiki
Jump to: navigation, search
Service Catalog Management
Related Topics
Get the Book
Knowledge.gif Service Catalog Admin

Contents

1 Overview

The service catalog supports several types of service catalog variables, which are also referred to as questions.

Some variable types accept variable attributes, as described in the sections below.

You can also attach help text to any service catalog variable.

Note
Note: The following variable types are not supported by the service catalog on mobile devices: Break, HTML, Label, List Collector, Macro, Macro With Label and UI Page.


2 Using Variable Attributes

Some variable types support specific variable attributes, which can be entered in the Variable attributes field.

Variable attributes.png

If multiple attributes are supported for a variable type, they can be specified in this field, separated by commas.

The following descriptions list the attributes supported for each variable type.

3 Break

Break

Displays a horizontal line across the form. Breaks are formatting elements; no data is collected.

4 CheckBox

Check Box

Creates a check box that may be selected or cleared. List check boxes in order under a label to create a multi-option question (as shown in the example).

5 Container Start, Container End

Container

A container is a question that holds other questions, similar to a variable set. Unlike a variable set, containers can be used anywhere (including inside a variable set) and can be nested (a container inside a container).

Containers offer:

  • Additional layout options: for example, to lay out questions in two columns. Note that check boxes must be wrapped with individual containers in order to be used in a two-column container.
  • A collapsible title bar: to save screen real estate.

To put questions in a container, add container start and container end variables before and after the questions (in order). For example, create the container in the example with variables in the following order:

  • Container Start (Memory & CPU Options), 50
  • CPU Speed, 100
  • Memory, 200
  • Container End, 250

To format the container as shown in the example, do the following in the container start variable:

  • Select a Layout of 2 Columns Wide, alternating sides.
  • Select the Display title option to use a collapsible title bar.


6 Date

Date

Creates a date input widget.

[top of page]

7 Date/Time

Date/Time

Creates a date and time input widget. Times are stored in Greenwich Mean Time (GMT) and are displayed in the current user's time zone.

8 HTML

HTML variables are useful for providing additional content for an item that requires more advanced formatting, including images. HTML variables are available in the Calgary release.

HTML variable

The variable can be:

  • Used for user input.
  • Used for reusable content when put into a variable set (for example, terms and conditions).
  • Available in two modes: Edit and Read-only. In edit mode, a toolbar is available, and links do not work. In read-only mode, no toolbar is available, and links work. To switch between modes, use entitlements or create a UI policy to set the HTML field to read-only mode.
  • Rendered without a title or border if it has no Question value and is read-only by entitlement (not by policy or script).
Note
Note: HTML variables are not currently supported for display on the shopping cart summary or approval summary screens. The available in summaries field is hidden on the variable form if the type is "HTML".


9 Label

Label

Displays a label across the form. Use labels to separate questions into sections (example, left) or list check boxes in order under a label to create a question for which the user can select several options (example, check boxes).

Labels are formatting elements; no data is collected.

10 List Collector

List Collector

Uses the list collector (slushbucket) interface to add multiple records from a table.

Supported attributes for this variable type:

  • no_filter: hides the filter fields that appear above a list collector.
Note
Note: This attribute is not a standard dictionary attribute, but is specific to the service catalog.


[top of page]

11 Lookup Multiple Choice

Lookup Multiple Choice, Down or Across

Creates radio buttons using data from a table. Functionality is similar to lookup select box, which creates a choice list from queried data. Define the query with:

  • Lookup from table: table from which to query data.
  • Lookup value field: field in the lookup table that populates the default variable value.
  • Lookup label field: field names (comma-separated list) that define the user choices.
  • Reference qual: supports reference qualifiers and advanced reference qualifiers. Returns all matching results (no maximum).
  • Choice direction: allows you to layout options horizontally (selecting Across), or vertically (Down), as shown in the screenshot.


Supported attributes for this variable type:

  • ref_qual_elements

For more information, see the available attributes list.

12 Lookup Select Box

Lookup Select Box

Creates a choice list using data queried from a table. Functionality is similar to lookup multiple choice, which creates radio buttons from queried data. Define the query with:

  • Lookup from table: table from which to query data.
  • Lookup value field: field in the lookup table that populates the default variable value.
  • Lookup label field: field names (comma-separated list) that define the user choices.
  • Reference qual: supports reference qualifiers. Returns all matching results (no maximum).

For example, to create the lookup select box in the picture, enter the following values:

  • Lookup from table: Incident [incident]
  • Lookup value field: Sys ID
  • Lookup label field: number, category, priority
  • Reference qual: caller_id=javascript:gs.getUserID()^active=true

Also see Select Box.

Supported attributes for this variable type:

  • ref_qual_elements

For more information, see the available attributes list.

13 Macro

Macro, glide_list with limited functions

Inserts a UI macro into the catalog item.

Note: UI macros in the service catalog do not support the following glide_list functions: clickthrough, slushbucket editing, and email field.

14 Macro with Label

Inserts a UI macro with a label.

15 Multi Line Text

Multi Line Text

Creates a multiple-line text input widget.

16 Multiple Choice

Multiple Choice

Creates radio buttons for question choices.

To lay out options horizontally, set Choice direction to Across.

17 Numeric Scale

Numeric Scale

Creates a horizontal set of radio buttons with numeric options from Scale min to Scale max (a Likert scale).

18 Reference

Reference

References a record in another table, similar to a reference field. For example, a variable named point_of_contact may reference the User [sys_user] table.

To set up a reference variable, define the question and select the Reference table.

Supports reference qualifiers and advanced reference qualifiers.

Keep the following information in mind as you work with reference variables:

  • Reference variables use the auto-complete feature. To ensure users have enough information, personalize the reference lookup list.
  • Clickthrough is not supported for reference variables.
  • Reference variables store the sys_id of the selected record (like reference fields). To use the display value in a script, use the same methods as for a reference field, as in two examples below.
current.variables.<variable name>.getDisplayValue()
current.variable_pool.<variable name>.getDisplayValue()

Starting with the Dublin release, supported attributes for this variable type are:

  • ref_auto_completer
  • ref_ac_columns
  • ref_ac_order_by

For more information on these attributes, see Auto-Complete for Reference Fields.

19 Select Box

Select Box

Creates a choice list from pre-defined question choices.

To change the -- None -- display value in select boxes, clear the Include none field on the variable and add a field with a Value of NULL and the desired label.

Also see Lookup Select Box.

20 Single Line Text

Single Line Text

Creates a single-line text input field.

Supported attributes for this variable type:

  • max_length: set the maximum character length. For example: max_length=200. The maximum value for max_length is 4000.
Note
Note: This attribute is not a standard dictionary attribute, but is specific to the service catalog.


21 UI Page

Inserts a UI page into the catalog item.

[top of page]

22 Wide Single Line Text

Wide Single Line Text

Creates a single-line text input field that spans the form, allowing for longer input.

Supported attributes for this variable type:

  • max_length: set the maximum character length. For example: max_length=200. The maximum value for max_length is 4000.
Note
Note: This attribute is available with the Aspen release. This is not a standard dictionary attribute, but is specific to the service catalog.


23 Yes/No

Yes / No

Creates a choice list with Yes and No as options.


Was this article helpful?
Yes, I found what I needed
No, I need more assistance
Views
Personal tools