---
sourceDocument: Australia Telecommunications Network Inventory
sourceDocumentLink: https://www.servicenow.com/docs/r/australia/telecom-network-inventory

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia Telecommunications Network Inventory

ft:clusterId :

    - telninv

bundleId :

    - telninv

workflow :

    - Customer and Industry


---

# Name pattern validation

# Name pattern validation {#ariaid-title1}

Release version: Australia  
Updated November 19, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 2 minutes to read
Summarize  
![AI sparkle icon](https://servicenow.com/docs/portal-asset/ai-sparkle-icon) Summarized using AI  
This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.  

## Summary of Name pattern validation

Name pattern validation in ServiceNow runs twice to ensure naming consistency and prevent errors: once during save-time and once when loading the Inventory Template Overview tab hierarchy.
This dual validation approach helps catch both syntax or evaluation errors and cross-template naming conflicts.
Show full answer Show less  

## Save-time validation

* Occurs when creating or editing a name pattern in the Define name pattern modal.
* Confirms the pattern is a valid expression producing a non-empty string before allowing the pattern to be applied.
* Displays immediate feedback:
  * **Valid pattern:** Shows a green confirmation message and a sample resolved name preview; Apply button is enabled.
  * **Invalid or empty result:** Shows a red error message and blocks Apply; this includes invalid JavaScript, unresolved variables, or empty outputs.
* The pattern is only saved when Apply is clicked on a valid pattern and the record is saved; otherwise, changes are discarded.

## Hierarchy render validation

* Triggered when the Inventory Template Overview tab loads the template hierarchy.
* Runs registered validation providers against resolved names of sibling templates at each tree level.
* Includes a default validation provider that checks for duplicate resolved names among siblings under the same parent, flagging conflicts with error badges.
* Allows extension or replacement of the default validation by registering custom validation providers.
* Combines multiple validation errors on the same template into a single Validation failed banner with errors separated by semicolons, while the error badge on the tree node shows only one label from the last flagged provider.

## Handling unresolvable variables

* Name patterns may reference variables not applicable in certain template contexts (e.g., parentslotname for a top-level slot).
* Such unresolvable variables are displayed as "?" in the resolved name on the tree node label to visually indicate the mismatch.
* This substitution is purely informational and does not trigger validation errors or error badges.

## Practical impact for ServiceNow customers

* Ensures name patterns are syntactically correct and produce meaningful, non-empty names before saving.
* Helps maintain uniqueness of template names within hierarchical siblings, reducing naming conflicts.
* Provides clear, consolidated feedback on validation failures for quick troubleshooting.
* Supports customization to enforce organization-specific naming standards through additional validation providers.
* Visual indicators help identify potential issues with variable usage in name patterns relative to template hierarchy position.  
Name pattern validation runs twice. It runs at save time to prevent errors. And it runs when the Overview tab loads the hierarchy to catch issues specific to template relationships.

Save-time validation
:   Evaluates whether the pattern is a valid expression that produces a non-empty string.

Hierarchy render validation
:   Evaluates cross-template rules registered as validation providers --- for example, duplicate names among siblings.

## Save-time validation {#naming-pattern-validation__save-time-validation}

When you create or edit a pattern in the Define name pattern modal, the modal validates the pattern before you can apply it. Two outcomes are visible in the modal:

* Pattern accepted: A green message appears beneath the input: Valid name pattern. Preview: \<resolved name\>. The resolved name in the preview is a sample evaluation. The Apply button is enabled.
* Pattern invalid or produces an empty result: A red message appears: Name pattern results in empty name. Please try again. The Apply action is blocked. The same message appears if the pattern has invalid JavaScript, references a variable that does not exist, or produces an empty string when evaluated.

{#naming-pattern-validation__ul_x1b_x3d_xjc}

The pattern is committed to the record only when you select Apply on a valid pattern and then save the underlying record. If you close the modal or close the record without saving, the pattern is not
persisted.

## Hierarchy render validation {#naming-pattern-validation__overview-render-validation}

When the Inventory Template Overview tab evaluates the hierarchy, registered validation providers run against the resolved names of related templates. Each provider evaluates siblings under a single parent at
one tree level at a time and records validation results for any related template that fails its rule.

The application includes a default duplicate-name check that flags two or more siblings whose patterns resolve to the same name. For example, if two slots at the same level both resolve to `Slot -5`, both slots are
flagged. The check is scoped to direct siblings of the same parent and does not compare names across different branches.

You can extend or replace this default check by registering additional validation providers. For more information, see [Extension point for custom name validation](https://www.servicenow.com/docs/s4l5gViXtJg0QWdr8s9Utw "The custom name validation extension point validates resolved names in the Inventory Template Overview tab. Administrators can register custom validation rules to enforce organization-specific naming conventions, replacing or extending the default check.").

## Multiple validation rules {#naming-pattern-validation__multiple-validation-rules}

When multiple validation rules flag the same related template, the Overview tab combines their outputs:

* The Validation failed banner concatenates the error descriptions from all providers that flagged the related template, separated by `; ` (semicolon and space). All errors are visible in one banner.
* The Error badge on the tree shows only one label. When multiple providers each write a badge label, the badge displayed on the node is set by the last provider to flag the related template.

The following banner shows output when a related template fails both a custom check and the default duplicate-name check.

    Validation failed: Slot name exceeds maximum length: Slot -4; Duplicate name at same level: Slot -4

## Unresolvable variables in resolved names {#naming-pattern-validation__unresolvable-variables}

Patterns can reference variables that have no value in a particular related template's context. For example, a top-level slot directly under an equipment template has no parent slot, so the variable
`parent_slot_name` can't be resolved for it.

When the Inventory Template Overview detects an unresolvable variable, it substitutes `?` for the variable in the resolved name on the tree node label . The `?` substitution
is a signal that the pattern is using variables that do not fit the related template's position in the hierarchy.  
Note:  
The `?` substitution does not raise an Error badge or a Validation failed banner. It is a display-only indicator in the tree node label.
**Related concepts**   

* [Inventory template hierarchy view](https://www.servicenow.com/docs/OS5FfXQqJRLARW~lpc5gSw "The Overview tab on an inventory template record shows the full template hierarchy as a tree. Use it to check resolved CI names and spot validation errors before deploying the template.")
* [Extension point for custom name validation](https://www.servicenow.com/docs/s4l5gViXtJg0QWdr8s9Utw "The custom name validation extension point validates resolved names in the Inventory Template Overview tab. Administrators can register custom validation rules to enforce organization-specific naming conventions, replacing or extending the default check.")
* [Inventory template naming patterns](https://www.servicenow.com/docs/Ur7JKaJYvarOaFuXVjwhTg "A naming pattern is a JavaScript expression that defines how a configuration item (CI) is named when it is created from an inventory template.")

