---
schema_version: "1"
id: 9b006fc159614a45529cff089fa6b30eec11598f181bdb59077a563f0aa3f75a
title: Guidelines for Accessing Formula Element Data in Repeatable Blocks
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_evaluating_elements_in_repeatable_blocks_21869_formula.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_evaluating_elements_in_repeatable_blocks_21869_formula.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 5a7af6b97e47f40a5c50ef6fb355ee8ba59b50c82764bbc42ab62ca9365fce36
description: When you use a Formula element within a repeatable block, review guidelines and examples for accessing data within or outside the same repeatable block.
products:
  - Omnistudio
release: "264"
---
# Guidelines for Accessing Formula Element Data in Repeatable Blocks

When you use a Formula element within a repeatable block, review guidelines and examples for accessing data within or outside the same repeatable block.

## Guidelines

When using Formula elements inside multi-level repeat blocks, if the Formula elements are not placed in the top-level block, it appears as null or false. This can cause issues when trying to use them on the page. In the Omniscript preview, you can verify this behavior by inspecting the formula elements in the JSON. These elements are either absent, or return null or false, regardless of the intended formula logic.

Within a repeatable block containing a Formula element, access the data in another element by referencing the element in the Formula element’s Expression property. Use these guidelines:

<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="d68405e47">Location of Data</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d68405e50">How to Access the Data</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Location of Data" class="slds-cell-wrap" style="vertical-align:top;" headers="d68405e47 ">Different element inside the same repeatable block</td>

            <td data-label="How to Access the Data" class="slds-cell-wrap" style="vertical-align:top;" headers="d68405e50 ">
              <p>In the Expression property of the Formula element, enter
                <code>BlockName|n:ElementName</code>.
              </p>
              <p style="margin-bottom:0;">When the Omniscript runs, it accesses
                only the elements in the current block.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Location of Data" class="slds-cell-wrap" style="vertical-align:top;" headers="d68405e47 ">Different repeatable block</td>

            <td data-label="How to Access the Data" class="slds-cell-wrap" style="vertical-align:top;" headers="d68405e50 ">In the Expression property of the Formula element, enter
              <code>BlockName|1:ElementName</code> (where the number after
              <code>BlockName|</code> is the block’s count in the Omniscript).
            </td>

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

![Example 1: Formula Element That Accesses Data Within the Same Block](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Example 1: Formula Element That Accesses Data Within the Same Block In this example, a Formula element references data from another element within the same repeatable Block element. The unlabeled block is repeatable (1).

![Omniscript design for summer camp enrollment form, with an unlabeled block element (1) containing Name, Birthday, and Age fields](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/omnistudio/images/repeatable_block_ex1_01.png)

In the properties for the unlabeled block, Enable Repeat is selected. (Edit Block elements are automatically repeatable.)

![Properties panel for block named blockUnlabeled, with Enable Repeat option selected](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/omnistudio/images/repeatable_block_ex1_02.png)

Properties for the Name element.

![Properties panel for the Name element in the summer camp enrollment form](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/omnistudio/images/repeatable_block_ex1_03.png)

Properties for the Birthday element.

![Properties panel for the Birthday element in the summer camp enrollment form](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/omnistudio/images/repeatable_block_ex1_04.png)

Properties for the Age (Formula) element include the formula `AGE(%blockUnlabeled|n:childBirthday%)`.

![Properties panel for the Age element in the summer camp enrollment form, with a formula in the Expression property](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/omnistudio/images/repeatable_block_ex1_05.png)

Preview shows the repeating Formula element calculation as each child’s age.

![Preview of the summer camp enrollment form with two entries, with Name, Birthday, and Age fields for each child](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/omnistudio/images/repeatable_block_ex1_06.png)

![Example 2: Formula Element That Accesses Data in a Different
Block](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Example 2: Formula Element That Accesses Data in a Different Block

In this example, the Formula element Total references the data from the Age element, which is in a different repeatable block.

![Omniscript design for summer camp enrollment form, with Name, Birthday, and Age plus a Formula element labeled Children Under 5. An arrow points from Children Under 5 to the Age element.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/omnistudio/images/repeatable_block_ex2_01.png)

The properties for the block and elements within Child Information are the same as in Example 1.

In the properties for the Formula element Total, the formula `COUNTIF(%childAge%, <5)` references the Age element in the previous block.

![Properties panel of the Formula element Total, with the formula in the Expression property](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/omnistudio/images/repeatable_block_ex2_02.png)

Preview shows the total entries that meet the criterion in the formula, by using data from the Age element.

![Preview of the summer camp enrollment form with entries for two children and the total number of children under 5](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/omnistudio/images/repeatable_block_ex2_03.png)

#### See Also

- [Combine Elements Logically in a Block](https://help.salesforce.com/s/articleView?id=xcloud.os_block_14180.htm&release=264.0.0&type=5 "Combine logical groups of elements in an Omniscript Step using a Block element. Blocks help to group information to create nested JSON data. Blocks are contained within steps and can be repeated to capture an array of data. For example, street, city, state, and postal code elements can be combined into an address block.")
- [Manage Records with an Edit Block](https://help.salesforce.com/s/articleView?id=xcloud.os_edit_block_14256.htm&release=264.0.0&type=5 "Create, edit, and delete multiple Salesforce or external records on one page using Edit Block. For example, if you're collecting an Account's Contact information, you can add an Edit Block to your Omniscript to enable users to add a record for each Contact.")