---
title: Creating and testing approval expressions
description: Configure a Spring Expression Language (SpEL) expression to manage promotion approval requirements for your environment.
component: pingcentral
version: 1.14
page_id: pingcentral:pingcentral_for_iam_administrators:pingcentral_create_test_expressions
canonical_url: https://docs.pingidentity.com/pingcentral/2.2/pingcentral_for_iam_administrators/pingcentral_create_test_expressions.html
llms_txt: https://docs.pingidentity.com/pingcentral/llms.txt
docs_for_agents: https://developer.pingidentity.com/build-with-ai/docs-for-agents.md
revdate: June 25, 2024
superseded_by: https://docs.pingidentity.com/pingcentral/2.2/pingcentral_for_iam_administrators/pingcentral_create_test_expressions.html
section_ids:
  before-you-begin: Before you begin
  about-this-task: About this task
  steps: Steps
  result: Result:
  result-2: Result:
---

# Creating and testing approval expressions

Configure a Spring Expression Language (SpEL) expression to manage promotion approval requirements for your environment.

## Before you begin

When you configure an environment, on the **Connection** page, select **Require Approval If Any Expression Fails** or **Require Approval If Any Expression Succeeds** from the **Approval Expression** list. For more information, see [Adding environments](pingcentral_add_environments.html).

## About this task

You can use SpEL expressions to determine whether an application requires approval or not. For more information on SpEL, see [Spring Expression Language (SpEL)](https://docs.spring.io/spring-framework/docs/3.0.x/reference/expressions.html) in the Spring Framework documentation. TIP: The approval expression should handle different application types and the promotional configurations associated with each application type.

## Steps

1. On the **Connection** page, in the **Approval Expression** field, click **Test** to expand the **Test Spring Expression** window.

   ### Result:

   The **Test Spring Expression** window displays.

2. In the **Application Configuration** field, enter the available application configuration.

3. **Optional:** In the **Promotion Configuration** field, enter the promotion configuration corresponding to the provided application configuration.

4. Under the **Spring Expression** field, click **Test Expression** to test your SpEL expression.

   |   |                                                                                               |
   | - | --------------------------------------------------------------------------------------------- |
   |   | The PingCentral API expects the application and promotion configuration to be a JSON payload. |

   ### Result:

   The **Spring Expression** result displays.

   For information about approval expression handling, see the following:

   * If you selected **Require Approval If Any Expression Fails** from the **Approval Type** list: If any expression results in `false` then approval is required. If all expressions are `true` then approval is not required.

   * If you selected **Require Approval If Any Expression Succeeds** from the **Approval Type** list: If any expression results in `true` then approval is required. If all expressions are `false` then approval is not required.

   * If any of the expressions do not return a Boolean value or if there are any errors in the expressions, the promotions will require approval.

   * Multiple expressions can be added, and are evaluated sequentially from top to bottom in an IF/ELSE chain. You can change the order in which these expressions display in the list by dragging and dropping them into different locations within the list.

5. Click the **Update** button to save your configuration or click the **Cancel** button to discard it.
