sys_choice
sys_choice
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
orencodedQuery=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:
- english only: https://demo.squid46.io/sys_choice?encodedQuery=base_element=os^base_language=en
- all languages: https://demo.squid46.io/sys_choice?encodedQuery=base_element=os
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:
- english only: https://demo.squid46.io/sys_choice?encodedQuery=base_element=environment^base_language=en
- all languages: https://demo.squid46.io/sys_choice?encodedQuery=base_element=environment
Or use the predefined sys_choice_environment
.
Properties
Property | Label | sys_choice | Datatype |
---|---|---|---|
sys_id | Sys ID | string | |
element | Element | string | |
label | Label | string | |
language | Language | string | |
name | Table | string | |
value | Value | string |
(Generated 2024-07-20T11:13:01.032Z)