---
schema_version: "1"
id: 0f9888b20328b0dcfd17d14ba316e744bfd11784c2d0a42c22ac04b848cd30b4
title: Subexpression
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/bre_subexpression_element.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.bre_subexpression_element.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: b614b2e7eee33ad0cd2311397de689d77b144c11210d11582ad2f1120ce356d7
description: When you add a subexpression step element to an expression set version, you can select another expression set that you want to use within the version. The subexpression then returns the result of the expression set to the version that the subexpression is used in. You can use resources from a subexpression, including any input and output variables from lookup tables in the subexpression in other steps in the expression set version. You can use only expression sets with at least one active version as subexpressions in an expression set version.
products:
  - Industry Solutions
  - Cross Cloud
release: "264"
---
# Subexpression

When you add a subexpression step element to an expression set version, you can select another expression set that you want to use within the version. The subexpression then returns the result of the expression set to the version that the subexpression is used in. You can use resources from a subexpression, including any input and output variables from lookup tables in the subexpression in other steps in the expression set version. You can use only expression sets with at least one active version as subexpressions in an expression set version.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions for clouds that have Business Rules Engine enabled</td></tr></tbody></table>

Here are the considerations for using expression sets as subexpressions:

- Expression sets can have a depth of up to two levels of subexpressions. For example, an expression set A that doesn't reference any subexpressions is considered to have a depth of 0. If A references B, whose depth is 0, A has a depth of 1. If B references another subexpression C, then B has a depth of 1, and A has a depth of 2. However, if C further references D, then the depth of A becomes 3 levels, which isn’t supported.
- When an expression set that has multiple active versions is used as a subexpression in another expression set, the subexpression version with the highest rank is considered.
- You can’t modify the versions of a subexpression if the modifications change the input and output variables in the parent expression set.
- You can modify a subexpression if your changes are additions that don’t modify the existing variables in the parent expression set.
    
    ![Tip](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-business_rules_engine-264-0-0-production-enus/b2d6dd5c-c231-428b-abbf-3dd2cd51a11f/images/icon_tip.png)
    
    Tip Because you can’t modify an active subexpression version, clone the version that you want to modify. Make the necessary changes. Next, give the version a higher rank than the previous versions, and save and activate the version. When the parent expression set is run the next time, the modified subexpression version with the higher rank is considered.
- If the expression set version has a context definition, the subexpression must be associated with the same context definition as its parent.

- **[Tips to Work with Subexpressions](https://help.salesforce.com/s/articleView?id=ind.bre_tips_to_work_with_subexpressions.htm&release=264.0.0&type=5)**  
    You can’t modify a subexpression version when it’s active. You can reuse an active subexpression without creating a subexpression from scratch. You can map the subexpression’s input and output variables to the local resources of the expression set version that the subexpression is used in. You can directly replace or delete subexpressions added in expression set versions, without deleting mapped variables or subsequent steps that reference the subexpression’s variables.