> For the complete documentation index, see [llms.txt](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/features/lifecycle-management/how-to/test-conditions-and-formatters.md).

# Test Conditions and Formatters

Evaluate a workflow condition or an attribute formatter against sample values, in the workflow editor or in a policy version's read-only view

## Overview

**Test** evaluates a condition or a formatter against sample attribute values, in the workflow editor or in a policy version's read-only view. It does not run the workflow.

Two dialogs are available:

* A workflow trigger condition or a condition node, in the **Test Condition** dialog
* An attribute formatter, in the **Test Formatter** dialog

Both dialogs are available in the workflow editor. They are also available in the read-only view of a policy version, except for the formatters listed in [Test in read-only view](#test-in-read-only-view).

{% hint style="warning" %}
A **Matched** result means only that the test values satisfy this one condition. It does not confirm that the workflow runs for an identity. To test a whole policy against identities, run a [dry run](/4yItIzMvkpAvMVFAamTf/features/lifecycle-management/how-to/test-policies-with-dry-run.md).
{% endhint %}

## Before you start

* The policy has at least one workflow with a trigger condition, a condition node, or an action with an attribute formatter.
* To change a condition or a formatter from the dialog, the policy has a draft version. Published and retired versions open in read-only view, where a change can be tested but not applied.

## Test a condition

The **Test Condition** dialog evaluates a condition string against entered values, or values copied from an existing identity.

1. Open the dialog:
   * In the workflow editor, select **Test** under the condition field: **Identity matches this condition** on the workflow trigger, or the condition field on a condition node. **Test** is unavailable until the condition string is valid.
   * In read-only view, select **Test** in the workflow or condition details. See [Test in read-only view](#test-in-read-only-view).
2. Under **Test Values**, enter a value for each attribute that the condition references.

   To use the attribute values of an existing identity instead, select **Fill From Identity**. In the **Fill From Identity** dialog, select an identity in the **Identity** list, then select **Fill Values**. The list contains only identities in this policy.
3. Select **Test Condition**.
4. Review the result under **Evaluation Results**. See [Read the evaluation results](#read-the-evaluation-results).
5. Optional: In the workflow editor, edit the string in the **Condition** field and select **Test Condition** again.
6. In the workflow editor, select **Apply Condition** to use the changed string in the workflow, or select **Cancel** to close the dialog without changing the workflow. **Apply Condition** is available only when the condition string is valid and differs from the original string.

Veza evaluates the condition against the configuration of the policy version under test, including the date format and time zone that `WHEN()` expressions use. See [Set the date format and time zone](/4yItIzMvkpAvMVFAamTf/features/lifecycle-management/policies-workflows/actions/trigger-conditions-reference.md#set-the-date-format-and-time-zone).

### Read the evaluation results

**Evaluation Results** shows a clause-by-clause breakdown of the condition:

* A **Matched** or **Not Matched** badge shows whether the test values satisfy the condition.
* Under **Condition String**, the dialog evaluates each clause separately and highlights any clause that cannot be evaluated.

For the operators and syntax that conditions support, see the [Trigger conditions reference](/4yItIzMvkpAvMVFAamTf/features/lifecycle-management/policies-workflows/actions/trigger-conditions-reference.md).

## Test a formatter

The **Test Formatter** dialog evaluates a formatter against sample values for the attributes it references.

1. Select **Test** next to the formatter. For where **Test** appears in the workflow editor, see [Testing Transformers Inline](/4yItIzMvkpAvMVFAamTf/features/lifecycle-management/transformers.md#testing-transformers-inline). For read-only view, see [Test in read-only view](#test-in-read-only-view).
2. Review the formatter under **Attribute Details**.
3. Under **Formatter Testing**, enter sample data for each attribute.
4. Select **Test Formatter** and review the **Formatter Output**.

## Test in read-only view

The read-only view is the [version page](/4yItIzMvkpAvMVFAamTf/features/lifecycle-management/policies-workflows/policy-and-version-pages.md#version-page) of a published or retired version, and of the draft version when it is not open in the workflow editor.

Open a workflow, condition, or action node's details on the version page's [**Workflows**](/4yItIzMvkpAvMVFAamTf/features/lifecycle-management/policies-workflows/policy-and-version-pages.md#workflows-tab) tab and select **Test**. **Test** is also available in the details of a common transformer.

In read-only view, both dialogs work as follows:

* The **Condition** field, and the **Attribute Details** fields of a formatter, are locked. The test uses the condition or formatter shown in the dialog.
* Test values remain editable. In the **Test Condition** dialog, **Fill From Identity** is available.
* The footer shows only **Close**.

Read-only view does not offer **Test** for date formatters, access review name formatters, or email formatters. To test these formatters, open the draft version in the workflow editor. **Test** is also not available in dry run result details.

## See also

* [Trigger conditions reference](/4yItIzMvkpAvMVFAamTf/features/lifecycle-management/policies-workflows/actions/trigger-conditions-reference.md)
* [Attribute sync and transformers](/4yItIzMvkpAvMVFAamTf/features/lifecycle-management/transformers.md)
* [Transformer reference](/4yItIzMvkpAvMVFAamTf/features/lifecycle-management/transformers/transformer-reference.md)
* [Policy page and version page](/4yItIzMvkpAvMVFAamTf/features/lifecycle-management/policies-workflows/policy-and-version-pages.md)
* [Test policies with dry run](/4yItIzMvkpAvMVFAamTf/features/lifecycle-management/how-to/test-policies-with-dry-run.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.veza.com/4yItIzMvkpAvMVFAamTf/features/lifecycle-management/how-to/test-conditions-and-formatters.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
