Service Catalog variable attributes
Summarize
Summary of Service Catalog Variable Attributes
ServiceNow's Service Catalog allows for the customization of catalog variables through specific attributes that define their behavior and restrictions. These attributes can be configured in the Variable attributes field under the Type Specifications tab of the Catalog variable form. Multiple attributes can be specified by using commas, and multiple values for each attribute can be separated by semicolons.
Show less
Key Features
- allowedextensions: Specifies allowed file types (e.g., allowedextensions=txt;pdf) for attachments.
- barcode: Indicates if a barcode can be scanned (e.g., barcode=true) for single-line text variables.
- maxfilesize: Sets the maximum file size for attachments (e.g., maxfilesize=2 for 2 MB).
- glidelist: Changes the list collector interface from slushbucket to glide list.
- issearchablechoice: Enables search functionality for selecting values in lookup select boxes (e.g., issearchablechoice=true).
- maxlength: Limits the number of characters inputted (e.g., maxlength=200 for address entry).
- maxunit: Defines the maximum time unit for duration variables (e.g., maxunit=minutes).
- nofilter: Hides filter fields above list collectors.
- refaccolumns: Specifies additional columns for auto-completion (e.g., refaccolumns=username;email;syscreatedon).
- refacorderby: Determines the sorting column for auto-completion (e.g., refacorderby=name).
- refautocompleter: Defines the JavaScript class for auto-completion choices (e.g., AJAXReferenceCompleter).
- refqualelements: Lists fields sent back to the server for updated references.
Key Outcomes
By configuring these variable attributes, ServiceNow customers can enhance the functionality and user experience of their Service Catalog. This customization enables better control over data input, improves usability through features like auto-completion and search capabilities, and ensures compliance with specific requirements for file uploads and text entries. Customers can expect a more tailored and efficient catalog experience for their users.
There are a few Service Catalog variables support specific attributes to define the behavior and restrictions for variables.
In the Catalog variable form, under the Type Specifications tab, you can specify the variable attributes in the Variable attributes field.
- You can enter multiple attributes for a variable type by separating each with a comma.
- You can enter multiple values for an attribute by separating each with a semicolon.
- If you don't see the Variable attributes field, enable the Show attributes when Type is One of Certain Values UI policy.
- Pre-selected values are not cleared automatically when the dependent variable value changes when using an attribute or reference qualifier. Create a client script to clear the values based on your needs and the needs of your customer.
Variable attributes
- allowed_extensions
Specifies a list of allowed file types. For example, allowed_extensions=txt;pdf.
Applicable variables: Attachment- barcode
Specifies if the barcode can be scanned using the mobile camera for identifying a variable value of a catalog item. For example, barcode=true.
Applicable variables: Single Line Text- max_file_size
Specifies the maximum file size in MB. For example, max_file_size=2.
Applicable variables: Attachment- glide_list
Changes the list collector interface from slushbucket to glide list.
Applicable variables: List collector- is_searchable_choice
If set to true, enables you to search for and select the required value for the variable. For example, is_searchable_choice=true.
Note:Applicable variables: Lookup select box, Select box- For Lookup select box, a default value is available at the page load itself.
- This attribute is not applicable in Service Portal.
- max_length
Sets the maximum number of characters allowed in the field. By default, the field accepts long strings of text, several thousand characters. Set the max_length attribute as appropriate for the information that the variable is collecting. For example, to allow for entry of an address, set max_length=200, or other appropriate length.
Applicable variables: Single-line text, Wide single-line text- max_unit
Sets the maximum unit of time for the duration. Possible values are max_unit=days,max_unit=hours,max_unit=minutes, and max_unit=seconds.
For example, if max_unit=minutes, the duration is displayed in minutes and seconds. In this case, a duration of 2 days 3 hours 5 minutes 15 seconds is displayed as 3065 minutes 15 seconds.
Applicable variables: Duration- no_filter
Hides the filter fields that appear above a list collector.
Applicable variables: List collector- ref_ac_columns
- Specifies the columns with display values that appear in an auto-completion list in addition to the name. Separate column names with a semicolon. For example,
ref_ac_columns=user_name;email;sys_created_on allows auto-complete to match text from the user_name, email, and sys_created_on columns.
Applicable variables: Reference, Requested For.
- ref_ac_order_by
Specifies the column that is used to sort the auto-completion list. For example, ref_ac_order_by=name sorts the auto-completion choices alphabetically by name.
Applicable variables: Reference- ref_auto_completer
Specifies the name of a JavaScript class (client-side) that creates the list for auto-completion choices. Valid class values include:
- AJAXReferenceCompleter: Displays matching auto-complete choices as a drop-down list. The list only displays the display value column of the reference table. If there is no other auto-completion class specified, reference fields automatically use this class.
- AJAXTableCompleter: Displays matching auto-complete choices as rows in a table. The table displays the display value column of the reference table and any columns listed in the ref_ac_columns attribute.
- AJAXReferenceChoice: Displays matching auto-complete choices as a drop-down list. The list only displays the display value column of the reference table. The list only displays up to 25 matching choices. If there are more than 25 auto-complete choices, the reference field instead displays the choices with the AJAXTableCompleter class.
- ref_qual_elements
A list of fields to be sent back to the server to get an updated reference.
Applicable variables: Lookup multiple choice, Lookup select box, List Collector.