---
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: 2.2
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
revdate: June 27, 2024
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 manage promotion approval requirements for your PingCentral environment by creating custom approval expressions with Spring Expression Language (SpEL). These expressions will evaluate the application based on its JSON payload to determine whether an administrator will be required to approve promotions.

## 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 application configuration information as a JSON payload.

   If you have promotion configuration information, enter it as a JSON payload in the **Promotion Configuration** field.

3. In the **Spring Expression** field, use the following function to extract values from the JSON payload using a specified JSON path: `#jsonPath(\{JSON payload}, \{JSON path})`.

   Build your own expressions using the following variables:

   * *\#application*: Represents the type of application (OAuth, OIDC, SAML Service Provider (SP), or PingAccess) and its corresponding API model (**ClientApplicationView**, **ConnectionApplicationView**, or **PingAccessApplicationView**).

   * *\#oAuthApplicationPromotion*: Provides access to the **OAuthApplicationPromotionView** API model and promotion configuration information for OAuth and OIDC applications.

   * *\#samlSpApplicationPromotion*: Provides access to the **SamlApplicationPromotionView** API model and promotion configuration information for SAML SP applications.

   * *\#pingAccessApplicationPromotion*: Provides access to the **PingAccessApplicationPromotionView** API model and promotion configuration information for PingAccess applications.

   For help building expressions, see [SpEL approval expression examples](pingcentral_expression_examples.html) or [Spring Expression Language (SpEL)](https://docs.spring.io/spring-framework/docs/3.0.x/reference/expressions.html) in the *Spring Framework* documentation.

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

   ### 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.
