Loading

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 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 Break

Break

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

3 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).

4 Container Start, Container Split, 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 in order before and after the questions. Use a container split variable to define a manual split point if required. By default, the split is calculated at the 50% mark, with any extra rows shown on the left.

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.


5 Date

Date

Creates a date input widget.

6 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.

7 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".


8 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.

9 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 specific to the service catalog.


10 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: a list of fields to be sent back to the server in order to get an updated reference.

11 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 and advanced 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: a list of fields to be sent back to the server in order to get an updated reference.


12 Macro

Macro, glide_list with limited functions

Inserts a UI macro into the catalog item.

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

Note
Note: Please use phase one Jelly only for any UI macros added as variables, as phase two Jelly within the macro is not processed and appears on the page as standard content.



13 Macro with Label

Inserts a UI macro with a label.

14 Masked

Masked

Inserts a text input box. Text entered in this text box is masked out, with each keystroke represented as an asterisk (*) symbol. This is useful for questions asking for sensitive or confidential data such as passwords.

Masked variable types include a Type Specifications section to provide more details:

Masked Variable Form.png

  • Use confirmation: provide an additional prompt to ask the user to re-enter the data, confirming the text entered.
    Note: By default, checking that the confirmation matches the original answer is not enforced, and a user can enter two different answers without affecting processing. To enforce checking, set the variable to be mandatory.
  • Use encryption: store the answer encrypted in the database. If not encrypted, the answer is stored in plain text format. Encryption uses Triple DES.

Masked variable types are available starting with the Fuji Release.

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, configure 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.

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 specific to the service catalog.


21 UI Page

Inserts a UI page into the catalog item.

Note
Note: Please use phase one Jelly only for any UI page added as variables, as phase two Jelly within the UI page is not processed and appears on the page as standard content.



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 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