@servicenow/sdk - v4.9.0
    Preparing search index...

    Interface ChoiceSet<T, F>

    Defines a set of choices to add to a ServiceNow table field.

    Use this API when adding choices to a field not owned by the current app — for example, a platform field like operational_status inherited from cmdb_ci.

    For choices on fields owned by the current app, prefer inline choices in the Table API instead.

    interface ChoiceSet<
        T extends TableName,
        F extends keyof FullSchema<T> | SystemColumns | string & {} = string,
    > {
        choices: {
            [value in string & Record<never, never> | number & Record<never, never>]?: ChoiceValue
        };
        field: F;
        table: T;
    }

    Type Parameters

    Index

    Properties

    Properties

    choices: {
        [value in string & Record<never, never> | number & Record<never, never>]?: ChoiceValue
    }

    Map of choice values to their configuration. Keys are the choice values stored in the database (e.g., 'pending', '100'). Values define the label and optional properties for each choice. When the field has known choices from downloaded dependencies, autocomplete suggests them.

    To remove a choice, delete it from this map. The build automatically tracks removed choices via the keys system and writes removed_choices to the XML payload.

    field: F

    The field name on the table to add choices to

    table: T

    The ServiceNow table containing the target field