---
schema_version: "1"
id: a10bb00a0acf80ab22c47c982aad4509a57fdfcc58f1d9b29092e0a167ea3bf7
title: Tips to Work with Subexpressions
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/bre_tips_to_work_with_subexpressions.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.bre_tips_to_work_with_subexpressions.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 7b21d35f9cffd238a8542593fdf8c1e031932109b59fafe57418f3ac1e392e6c
description: 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.
products:
  - Industry Solutions
  - Cross Cloud
release: "264"
---
# Tips to Work with Subexpressions

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.

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

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
      <colgroup>
        <col style="width:50%">
        <col style="width:50%">
      </colgroup>
      <thead class="slds-text-title_caps ">
        <tr class="">
          <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d11464e67">Scenario</th>
          <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d11464e70">Tips</th>
        </tr>
      </thead>
      <tbody>
        <tr class="">
          <td data-label="Scenario" class="slds-cell-wrap" style="vertical-align:top;" headers="d11464e67 ">
            <p>A subexpression version with the highest rank is used as a step in an expression
              set version. You want to update the steps in the subexpression version without
              changing the input and output variables.</p>
            <p style="margin-bottom:0;">For example, the subexpression version has
              10 input and output variables. Without changing any variable, you want to update the
              calculation formulas or the conditions that the variables are used in.</p>
          </td>

          <td data-label="Tips" class="slds-cell-wrap" style="vertical-align:top;" headers="d11464e70 ">
            <ul>
              <li>Save the subexpression version as a new version. </li>
              <li>Update the step elements and save the version.</li>
              <li>Give the version the highest rank.</li>
              <li>Activate the version.</li>
            </ul>
            <p style="margin-bottom:0;">When the parent expression set version is run the next time, the updated
              subexpression version that has the highest rank is considered.</p>
          </td>

        </tr>
        <tr class="">
          <td data-label="Scenario" class="slds-cell-wrap" style="vertical-align:top;" headers="d11464e67 ">A subexpression version with the highest rank is used as a step in an expression
            set version. You want to use some steps and variables in the subexpression version,
            but you also want to make other changes that require you to add or remove
            variables.</td>

          <td data-label="Tips" class="slds-cell-wrap" style="vertical-align:top;" headers="d11464e70 ">
            <ul>
              <li>Deactivate the version of the parent expression set that references the
                subexpression.</li>
              <li>Remove the subexpression from the parent expression set version.</li>
              <li>Deactivate the subexpression version that you want to modify.</li>
              <li>Modify the version.</li>
              <li>Verify that the version has the highest rank.</li>
              <li>Activate the version.</li>
              <li>Add the subexpression back to the parent expression set version, and activate
                the version.</li>
            </ul>
            <p style="margin-bottom:0;">When the parent expression set version is run the next time, the version
              considers the updated subexpression version.</p>
          </td>

        </tr>
        <tr class="">
          <td data-label="Scenario" class="slds-cell-wrap" style="vertical-align:top;" headers="d11464e67 ">When a subexpression version is added in an expression set version step,
            variables are automatically created in the expression set version corresponding to the
            subexpression’s variables. You now want to map the subexpression’s variables to
            different local resources in the expression set version.</td>

          <td data-label="Tips" class="slds-cell-wrap" style="vertical-align:top;" headers="d11464e70 ">
            <ul>
              <li>Click the <strong class="uicontrol">Map Variables</strong> button on the subexpression step
                of the expression set version. The subexpression’s input and output variables are
                listed.</li>

              <li>Choose the expression set version’s local resource that you want to map your
                subexpression’s variables to.</li>

              <li>After you map the subexpression’s variables explicitly, the corresponding
                variables that were automatically created in the expression set version are now
                deleted.</li>

            </ul>
          </td>

        </tr>
        <tr class="">
          <td data-label="Scenario" class="slds-cell-wrap" style="vertical-align:top;" headers="d11464e67 ">A subexpression is used in an active expression set version and its output
            variables are used in subsequent calculation steps of the expression set version. You
            now want to delete the subexpression from the expression set version.</td>

          <td data-label="Tips" class="slds-cell-wrap" style="vertical-align:top;" headers="d11464e70 ">
            <ul>
              <li>Delete the subexpression step in the expression set version.</li>

              <li>The subexpression is deleted without explicitly deleting the subsequent
                expression set version steps that reference the subexpression’s variables.</li>

              <li>Variables that were automatically created in the expression set version
                corresponding to the deleted subexpression’s variables are now deleted.</li>

              <li>Fix any errors shown in the subsequent expression set version steps that
                reference the deleted subexpression’s variables.</li>

            </ul>
          </td>

        </tr>
        <tr class="">
          <td data-label="Scenario" class="slds-cell-wrap" style="vertical-align:top;" headers="d11464e67 ">A subexpression is used in an active expression set version and its output
            variables are used in subsequent calculation steps. You now want to substitute the
            subexpression in the expression set version with another one that better suits your
            business needs.</td>

          <td data-label="Tips" class="slds-cell-wrap" style="vertical-align:top;" headers="d11464e70 ">
            <ul>
              <li>In the subexpression step in the expression set version, click
                <strong class="uicontrol">X</strong> to remove the subexpression.
              </li>

              <li>Select the new subexpression that you want to use.</li>

              <li>The subexpression is changed without explicitly deleting the subsequent
                expression set version steps that reference the old subexpression’s
                variables.</li>

              <li>Input variables of the new subexpression that match the old subexpression’s
                variables are retained.</li>

              <li>Explicitly map the output variables of the new subexpression. </li>

              <li>Fix the errors that are shown in subsequent expression set version steps that
                reference the old subexpression’s variables.</li>

            </ul>
          </td>

        </tr>
      </tbody>
    </table>