# Group and environment parameters

> Add parameters to a group or an environment to control which fields appear on the order form and which values users can choose

---

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

---

Groups and environments have the same **Parameters** tab, and parameters work the same way on both. In Cloud Management Platform (CMP), a parameter on a group applies to orders in that group and its [subgroups](/docs/cmp/configure/order-forms-and-pricing/parameters/). A parameter on an environment applies to orders that deploy there. When a blueprint sets options for a parameter, the form offers only those options. Otherwise, it offers the options from both the group and the environment. See [How option order is determined](/docs/cmp/configure/order-forms-and-pricing/parameters/parameter-options/).

## Add a parameter to a group or environment

1. Open the group or environment:
    - For a group, go to **Groups** and select the group.
    - For an environment, go to **Admin** > **Environments** and select the environment.
1. Select the **Parameters** tab, then select **Add**.
1. Locate and select the parameter, then select **Add**.

![Screenshot of an environment's Parameters tab.](/img/cmp/use/blueprints/customize-order-form/group-and-environment-parameters/environment-parameters.png)

The parameter now appears on the order form for that group or environment. To create a new parameter, see [Adding and managing parameters](/docs/cmp/configure/order-forms-and-pricing/parameters/). Managing a group's parameters requires the **group.manage_parameters** permission.

### Example: Add an expiration date to an environment

The San Jose QA Lab environment's order form needs an *Expiration Date* parameter, which CMP uses to remind users to decommission their resources.

1. Go to **Admin** > **Environments** and choose San Jose QA Lab.
1. Select the **Parameters** tab.
1. Select **Add**.
1. Locate and select **Expiration Date** from the global parameter list.
1. Select **Add**.

## Set options for a parameter

1. On the group's or environment's **Parameters** tab, find the parameter's row.
1. In the Options column, select the edit icon.
1. Add the values to offer, then select **Save**.

The order form now shows a list of those values instead of a free-text field. To set a minimum, maximum, or regular expression instead, see [Constraints](/docs/cmp/configure/order-forms-and-pricing/parameters/parameter-options/). For more on fixed lists, see [Static options](/docs/cmp/configure/order-forms-and-pricing/parameters/static-options/).

### Example: Limit VM memory size to specific options

In the Acme group, limit the *Mem Size* parameter to 512 MB, 1 GB, 2 GB, and 4 GB.

1. Go to **Groups**.
1. Select the group.
1. Select the **Parameters** tab.
1. Select **Add**.
1. Locate and select **Mem Size**.
1. Select **Add**.
1. In that row's Options column, select the **edit** icon.
1. In the options dialog, add the values in gigabytes: 0.5, 1, 2, and 4.
1. Select **Save**.

The order form now shows a dropdown for memory size instead of a free-text field.

## Set a value without showing the field

If a required parameter has only one option for an order, CMP uses that value and leaves the field off the order form. An optional parameter also offers a blank choice, so it still appears as a list.

1. Give the parameter a single option on the group or environment.
1. Select the parameter's name to open its global settings.
1. Enable the **Required** toggle switch.

**Required** is a global setting, so it applies everywhere the parameter is used.

## Let users order several servers at once

To let users order more than one server in a single order, add a hostname template and the *Quantity* parameter. With a hostname template, the Hostname field becomes a read-only *Hostname Preview*, and CMP generates a unique name for each server.

1. On the **Parameters** tab, add the *Hostname Template* and *Quantity* parameters.
1. Give *Hostname Template* a single option, such as `web-00X`. See [Hostname specification](/docs/cmp/configure/order-forms-and-pricing/parameters/parameter-templates/hostname-specification/).

The order form then shows *Hostname Preview* and *Quantity* fields.

## Generate server annotations

Set the *Annotation* parameter to a template to record where each new server came from. See [Annotations specification](/docs/cmp/configure/order-forms-and-pricing/parameters/parameter-templates/annotations-specification/) for the context variables and supported platforms.

1. On the **Parameters** tab, add the *Annotation* parameter.
1. In its Options column, select the edit icon.
1. Enter a template, select **Add option**, then select **Save**. For example:

    ```django
    Built by {{ server.owner }} using CMP ({{ portal.site_url }})
    on {{ server.add_date|date:"SHORT_DATE_FORMAT" }}
    [Job ID={{ job.id }}, Order ID={{ order.id }}]
    ```

To keep the field off the order form, make *Annotation* required. See [Set a value without showing the field](#set-a-value-without-showing-the-field). To apply the template everywhere, set it as the parameter's global default instead.

## Related

- [Parameters](/docs/cmp/configure/order-forms-and-pricing/parameters/): Create parameters and manage inheritance and display order.
- [Parameter options](/docs/cmp/configure/order-forms-and-pricing/parameters/parameter-options/): How group, environment, and blueprint options combine.
- [Blueprint-level parameters](/docs/cmp/use/blueprints/customize-order-form/blueprint-level-parameters/): Set options for a single blueprint.
- [Networking](/docs/cmp/use/blueprints/customize-order-form/order-form-customization/networking/): Choose which networks a group or environment offers.
- [Order form customization](/docs/cmp/use/blueprints/customize-order-form/order-form-customization/): Every way to customize the order form.
