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

    Fields common to every metric, regardless of dataType. The data-type-specific fields live on the per-type branches of MetricConfig.

    type BaseMetricConfig = {
        active?: boolean;
        additionalInformationLabel?: string;
        allowAdditionalInformation?: boolean;
        allowNotApplicable?: boolean;
        condition?: string;
        condQuestion?: CondQuestion;
        context?: string | Record<"sys_cs_virtual_agent_context">;
        defaultAnswer?: string;
        definitions?: { [value: string]: MetricDefinitionValue };
        dependentPlugin?: DependentPlugin;
        dependsOn?: string | Record<"asmt_metric">;
        description?: string;
        details?: string;
        displayedWhen?: string | (string | Record<"asmt_metric_definition">)[];
        displayedWhenCheckbox?: string;
        displayedWhenTemplate?:
            | string
            | (string | Record<"asmt_template_definition">)[];
        displayedWhenYesNo?: string;
        fieldValidation?: string | Record<"sys_cs_field_script_validator">;
        hideLabel?: boolean;
        mandatory?: boolean;
        maximumNormalizationInput?: boolean;
        maxWeight?: number;
        method?: MetricMethod;
        name: string;
        order?: number;
        question: string;
        readOnly?: boolean;
        scored?: boolean;
        script?: string;
        sourceField?: string;
        valueParameters?: string;
        weight?: number;
    }
    Index

    Properties

    active?: boolean

    Whether the metric is active. DB: active. Default true.

    additionalInformationLabel?: string

    Label for the additional-information field. DB: add_info_label (translated_text, max 255). Default 'Additional Information'.

    allowAdditionalInformation?: boolean

    Allow free-text additional information alongside the answer. DB: allow_add_info. Default false.

    allowNotApplicable?: boolean

    Allow the assessor to mark the metric "not applicable". DB: allow_not_applicable. Default false.

    condition?: string

    Encoded query controlling when the metric applies. DB: condition (conditions, max 1000).

    condQuestion?: CondQuestion

    When the dependent question is asked. DB: cond_question. Default 'always'.

    context?: string | Record<"sys_cs_virtual_agent_context">

    Virtual Agent context for chat-based surveys. DB: context (reference sys_cs_virtual_agent_context).

    defaultAnswer?: string

    Source-record field used to pre-populate the default answer. DB: default_value_field (field_name).

    definitions?: { [value: string]: MetricDefinitionValue }

    Answer options / scale points for the metric (asmt_metric_definition), keyed by the option's stored value. Each entry is a display label (shorthand) or a MetricDefinitionConfig object. Applicable to choice, likertScale, numericScale, imageScale, multipleSelection and ranking answer types. Coalesced on value within this metric (the metric FK is wired automatically), so no $id is needed.

    The asmt_metric_definition.value column is numeric on the platform, so keys must be integer strings. Non-integer keys produce a build diagnostic.

    definitions: {
    '1': 'Dissatisfied',
    '2': 'Neutral',
    '3': { label: 'Satisfied', order: 300 },
    }
    dependentPlugin?: DependentPlugin

    Dependent plugin value. DB: plugin.

    dependsOn?: string | Record<"asmt_metric">

    Conditional question: the sibling metric this one depends on. Reference it with Now.ref('asmt_metric', '<id-or-sys_id>'), a Record<'asmt_metric'>, or a raw sys_id string; the plugin resolves it to the target metric's sys_id. DB: depends_on (reference asmt_metric).

    description?: string

    Help/description text. DB: description (translated_text, max 1000).

    details?: string

    Additional rich-text details. DB: details (translated_html, max 8000).

    displayedWhen?: string | (string | Record<"asmt_metric_definition">)[]

    Dependent answer value(s) that reveal this metric (used with dependsOn). DB: displayed_when (glide_list -> asmt_metric_definition). Use when the parent (dependsOn) metric has dataType: 'choice'. Values are the integer keys from the parent metric's definitions map.

    displayedWhenCheckbox?: string

    Reveal value when the parent (dependsOn) metric has dataType: 'checkbox'. DB: displayed_when_checkbox.

    displayedWhenTemplate?: string | (string | Record<"asmt_template_definition">)[]

    Reveal value when the parent (dependsOn) metric has dataType: 'template'. DB: displayed_when_template (glide_list -> asmt_template_definition).

    displayedWhenYesNo?: string

    Reveal value when the parent (dependsOn) metric has dataType: 'yesNo'. DB: displayed_when_yesno.

    fieldValidation?: string | Record<"sys_cs_field_script_validator">

    Field script validator applied to the answer. DB: field_validation (reference sys_cs_field_script_validator).

    hideLabel?: boolean

    Hide the metric label in the rendered survey. DB: hide_label. Default false.

    mandatory?: boolean

    Whether an answer is required. DB: mandatory. Default false.

    maximumNormalizationInput?: boolean

    Use the maximum value as the normalization input. DB: maximum_normalization_input. Default false.

    maxWeight?: number

    Maximum weight used when normalizing scores

    method?: MetricMethod

    Collection method for the metric. DB: method. Default 'assessment'.

    name: string

    Question label shown to the assessor. DB: name (string, max 255). Mandatory.

    order?: number

    Display order within the category (lower sorts first). DB: order (integer). Mandatory. Default 100.

    question: string

    Rich-text question body. DB: question (translated_text, max 512). Mandatory.

    readOnly?: boolean

    Render the metric as read-only. DB: read_only. Default false.

    scored?: boolean

    Whether the metric contributes to the score. DB: scored. Default false.

    script?: string

    Server script for scripted metrics. DB: script (max 4000). Prefer Now.include('./metric.js').

    sourceField?: string

    Field the metric reads from (data-collection metrics). DB: source_field (field_name).

    valueParameters?: string

    Name/value parameters for the metric. DB: value_parameters (simple_name_values, max 4000).

    weight?: number

    Relative weight within its category. DB: weight (decimal, max 15). Mandatory. Default 10.