SYSTEM$GET_ALERT_TEMPLATE
functionnot supportedUDFs, procedures, tasks, alerts, scriptingReturns the definition of a single alert template, including the variables you can set, their data types, defaults, allowed values, and a ready-to-adapt example statement. Use SYSTEM$LIST_ALERT_TEMPLATES to discover template identifiers, then use this function to inspect a template before you create an alert with CREATE ALERT … FROM TEMPLATE.
Syntax
SYSTEM$GET_ALERT_TEMPLATE( '<template_id>' )
Parameters
| Name | Required | Description |
|---|---|---|
template_id | required | The identifier of the template to return, as reported by SYSTEM$LIST_ALERT_TEMPLATES. The identifier is not case-sensitive. The returned payload reports the canonical identifier in template_id. |
Returns
Returns a JSON object with a single template field. The template object includes the same metadata that SYSTEM$LIST_ALERT_TEMPLATES reports for each template (template_id, template_version, display_name, alert_description, product, supports_new_data_schedule, default_schedule, scope, subcategories, runbook), plus the following: - template_variables. An array describing each variable you can set through the TEMPLATE_PARAMS clause. Each variable has: name. The variable name to use as a key in TEMPLATE_PARAMS. - display_name. A human-readable name. - description. Help text describing the variable. - data_type. The value type: STRING, NUMBER, or INTEGER. - semantic_type. The value category, such as PERCENTAGE, DURATION_HOURS, COUNT, or PLAIN_TEXT. - default_value. The value used when you omit the variable. - optional. Present and true when the variable is optional. Omitted otherwise. - options. For variables that accept a fixed set of values, the array of allowed values (for example, ["ACCOUNT", "DATABASE", "SCHEMA"] for a monitoring scope). - min, max, exclusive_min. For numeric variables that have a range, the lower bound, the upper bound, and whether the lower bound is exclusive. Fields are omitted when they don’t apply. - create_syntax. A ready-to-adapt CREATE ALERT … FROM TEMPLATE statement for the template, prefilled with defaults and sample values. Replace the placeholder object names before you run it. - alert_definition_template. The raw template body. This field is informational. You do not need it to create an alert with the FROM TEMPLATE clause.
Usage notes
- This is a read-only function. It does not require a running warehouse.
- A variable is required when it lacks both a default_value and an optional: true flag. There is no separate required field: requiredness is derived from default_value and optional.
- The options and min/max fields advertise exactly what the CREATE ALERT … FROM TEMPLATE clause enforces, so you can use them to build a valid TEMPLATE_PARAMS value before you run the statement.
- If the template ID doesn’t exist or you don’t have access to it, the function returns an object does not exist or not authorized error. Verify the identifier with SYSTEM$LIST_ALERT_TEMPLATES.