# Generate names

> Create Naming Sequences and Policies in OneFuse to dynamically generate names

---

Site [llms.txt](/llms.txt)

---

Create Naming Sequences, Validators, and Policies in the [OneFuse UI](/docs/onefuse/getting-started/ui-overview/). Naming Policies can be used instantly after creation.

Generate a name in four steps:

1. Gather and define the naming standard(s) that address your business needs.
2. Create a Naming Sequence.
3. Create a Naming Policy.
4. Call the Naming Policy via an [Upstream Provider](/docs/onefuse/consume/what-is-upstream-provider/).

## Create flexible and dynamic names

Extend the flexibility of your Naming Policy by applying a Sequence, [Templating](/docs/onefuse/concepts/templating/), and Validators.

### Use a Sequence

- A Naming Template without a sequence in a Naming Policy can result in a limited set of names.
- Use Sequence(s) in Naming Policies to automatically create names in sequential order.
- If consuming Naming Policies using Aria Automation 8, see how to use [Custom Resources](/docs/onefuse/consume/vmware-aria-automation/aria-automation-8x/modules/naming/#option-2-add-in-custom-resource-for-onefuse-naming) to influence deployment names.

Refer to [Sequences](/docs/onefuse/configure/modules/naming/components/#sequences) to learn more.

### Use templating with variables

The Naming Template field can include elements that make up the non-sequence part of the name and contain any combination of references to variables, static text (literal characters), and references to Sequences.

Words wrapped in double curly braces (for example, `{{ Environment }}`) are [Variables](/docs/onefuse/templating/#variables) that will result in the final value based on the input properties.

For our use case, the name generated will contain:

- The first lowercase letter from the variable **OS**
- The first lowercase letter from the variable **Environment**
- The first lowercase letter from the variable **Application**
- The word "test"

#### Create a Naming Policy

1. Log in to the OneFuse UI.
2. Select **Modules** > **Naming** from the left navigation menu.
3. Find the Naming Policies datatable and select **Create**.
4. Fill out the form:
   - **Name:** `templated`
   - **Sequence:** Select the sequence(s) desired.
   - **Template:**

     ```jinja2
     {{ OS | first | lower}}{{ Environment | first | lower }}{{ Application | first | lower }}test{{ sequence.REPLACE_WITH_SEQUENCE_NAME }}
     ```

   <div class="alert alert-info" role="alert"><div class="h4 alert-heading" role="heading">Sequence reference in Naming Template</div>


   If the Sequence name is `decimal_threedigit`, `{{ sequence.REPLACE_WITH_SEQUENCE_NAME }}` becomes `{{ sequence.decimal_threedigit }}`.

   If you have more than one sequence, include a reference to each sequence in the Naming Template:

   ```jinja2
   mytemplate{{ sequence.mysequence1 }}-{{ sequence.mysequence2 }}
   ```

   </div>


   <div class="alert alert-info" role="alert"><div class="h4 alert-heading" role="heading">Templating</div>


   The [first](/docs/onefuse/templating/filters/#first) and [lower](/docs/onefuse/templating/filters/#lower) Templating Filters are applied in this example.
   </div>


5. Select **Create**.

When the `templated` Naming Policy is executed, names will be generated similar to the following:

```text
Request 1: { "Environment": "production", "OS": "Linux", "Application": "Web Servers" }
=> lpwtest001

Request 2: { "Environment": "dev", "OS": "Windows", "Application": "Database" }
=> wddtest001
```

Refer to the [Templating guide](/docs/onefuse/templating/) to learn more.

### Use Validators

Associate Validator(s) to Naming Policies to validate that the name is unique in external system(s) in addition to the OneFuse database.

Refer to [Validators](/docs/onefuse/configure/modules/naming/components/#validators) to learn more.

## Track generated names

Track deployments for generated names until the name is released. View a list of names generated by OneFuse Naming Policies.

1. Log in to the [OneFuse UI](/docs/onefuse/getting-started/ui-overview/).
2. Select **Modules** > **Naming** from the left navigation menu.
3. Scroll down to the bottom of the page to see **Managed Names**.

   ![Managed Names](/img/onefuse/configure/modules/naming/generate-names/onefuse_101_ui_managed-object.png)
