Skip to main content

sys_choice

sys_choice

High volume resultset if unrestricted

This configuration - if requested without any further restrictions - will - on a typical ServiceNow instance - return an extremely high amount of entities. This can lead to timeouts and/or truncated results. See ServiceNow Configuration Parameter.

sys_choice is not an entity class, but a ServiceNow configuration table.

sys_choice allows access to various choice options. This gives peripheral systems access to valid values lists etc.

sys_choice is a fully unrestricted configuration that will - if no encodedQuery is added to the request - return the complete content of the table. That would be over 100.000 results in a vanilla ServiceNow instance. This is of limited to no value. It is however a good basis for you to exactly define what data you would like to retrieve.

The returned JSON will have the following structure:

{
"element": "os",
"label": "AIX",
"language": "en",
"name": "cmdb_ci_computer",
"sys_id": "5fef4253911021007a6a1d9043409e74",
"value": "AIX"
}
  • name is the ServiceNow table for which this choice list is defined.
  • element is the ServiceNow field name for which this choice list is defined.
  • label is the UI label.
  • language is the language of the entry.
  • value is the technical value that is set on the field of your entity.
  • sys_id is irrelevant in this context.

Usage

In most cases you will want to restrict the returned data by

  • element, e.g. encodedQuery=base_element=os or encodedQuery=base_element=environment
  • language: If you only want a specific language, add language as clause to the encodedQuery, e.g. encodedQuery=base_element=os^base_language=en

Use Cases

Valid Operating System Choices

A peripheral system wants to include an 'operating system' dropdown list in its own UI and ServiceNow is master of that data?

Try:

Or use the predefined sys_choice_os.

Valid Environment

A peripheral system wants to include an 'environment' (Production, Test, Developement) dropdown list in its own UI and ServiceNow is master of that data?

Try:

Or use the predefined sys_choice_environment.

Properties

PropertyLabelsys_choiceDatatype
sys_idSys IDstring
elementElementstring
labelLabelstring
languageLanguagestring
nameTablestring
valueValuestring

(Generated 2024-07-20T11:13:01.032Z)

We track. Ok?