# Change values of parameters and fields based on conditions using conditional values

Source: https://docs.uniform.app/docs/guides/composition/conditional-logic/conditional-values

> **Enterprise plan only:**
>
> Conditional values requires a [Uniform Enterprise plan](https://uniform.dev/pricing/).

Conditional values let you choose between one or more alternative values for component parameters or  content type fields ('properties') based on conditional expressions.

## Common use cases

- Define fallback values when external data is not available.
- Adjust layout settings or content based on current user context such as screen size or device type.
- Map technical details to human-readable values. E.g. map a country code to a country name.
- Translate external data attributes that are not translated by default. E.g. translate a product category name that is retrieved from an external product catalog.

## Supported condition criteria

| Criteria | Components & Compositions | Component patterns & composition patterns | Entries & Entry patterns |
| --- | --- | --- | --- |
| [Locales](https://docs.uniform.app/docs/guides/composition/conditional-logic#locales) | 🚫 Not supported | 🚫 Not supported | 🚫 Not supported |
| [Dynamic inputs](https://docs.uniform.app/docs/guides/composition/conditional-logic#dynamic-inputs) | ✅ Supported  <br>(if attached to a project map node) | ✅ Supported  <br>(via [global query strings](https://docs.uniform.app/docs/guides/composition/url-management/routing/dynamic-inputs#global-query-strings)) | 🚫 Not supported |
| [Quirks](https://docs.uniform.app/docs/guides/composition/conditional-logic#quirks) | ✅ Supported | ✅ Supported | 🚫 Not supported |
| [Dynamic Tokens](https://docs.uniform.app/docs/guides/composition/conditional-logic#dynamic-tokens) | ✅ Supported | ✅ Supported | ✅ Supported |

## Enabling Conditional values

Each property must enable conditional values on its component or content type definition. This is done by checking the "Enable conditional values" checkbox when adding or editing a parameter or field.

![Allow conditional values for a parameter of a component or field of a content type](https://docs.uniform.app/images/guides/composition/conditional-logic/allow-conditional-values.png)

Conditional values are not supported for fields of type `blocks`.

> **Tip:**
>
> Conditional values work in concert with localized values; when localized, each locale has its own independent set of conditional values.

## Creating Conditional values

To create a conditional value:

1. Open a component or entry and navigate to the property, that has conditional values enabled, and you want to add conditional values to.
2. In the property's  menu, choose "Manage conditional values…". This opens the conditional values editor in a drawer for the current locale.

   ![Manage conditional values menu](https://docs.uniform.app/images/guides/composition/conditional-logic/conditional-values-menu.png)
3. Click "Add conditional value" to add the first conditional value. The default value is automatically copied to the new conditional value. Adjust the value as needed.

   ![Add conditional value to a parameter](https://docs.uniform.app/images/guides/composition/conditional-logic/add-conditional-value.png)
4. The new conditional value starts of with no conditions, which means it is always used. Click the "No conditions defined" box, or choose "Manage conditions" from the value's  menu to open the conditional expression editor.

   ![Manage conditions of a conditional value](https://docs.uniform.app/images/guides/composition/conditional-logic/manage-conditions.png)

   When a conditional value has more than one condition, you can combine them with either `AND` or `OR` using the `and`/`or` selector on the second condition. See [Conditions](https://docs.uniform.app/docs/guides/composition/conditional-logic#conditions) for details.
5. Choose a conditional expression to show the component. As you work, the current result of the conditional expression is shown based on your current preview settings (i.e. preview product ID).

   ![Matching conditional value is shown in preview and in parameter](https://docs.uniform.app/images/guides/composition/conditional-logic/applied-conditional-value.png)
6. Click Accept. The condition is applied.

> **Order of condition evaluation:**
>
> When evaluating conditional expressions, Uniform starts at Condition 1 and uses the first matching conditional value. If no conditional values match, then the default value is used instead.
>
> You can reorder conditions in their  menu to control the order of evaluation.
