---
schema_version: "1"
id: b4a188c1974c5d5f21bcccca2e29f2e2a03a093607c37e2f15fe562320f2b66c
title: Add a Child Flexcard to Itself Recursively (Managed Package)
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_add_a_child_flexcard_to_itself_recursively.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_add_a_child_flexcard_to_itself_recursively.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 46cddba35ddad7c8d8e025e6037614d07375d318e5f6023a8b08264a70ca7774
description: For the managed package runtime, when a child Flexcard has hierarchical data, it can call itself recursively. When the Flexcard element is embedded in a child Flexcard, use the Is Recursive feature to display the children and grand-children of parent objects. The child Flexcard can add itself to itself again and again, each time passing the same child data field (also called a data node) available in each level of the data JSON, until that data field no longer exists or is empty.
products:
  - Omnistudio
release: "264"
---
# Add a Child Flexcard to Itself Recursively (Managed Package)

For the managed package runtime, when a child Flexcard has hierarchical data, it can call itself recursively. When the Flexcard element is embedded in a child Flexcard, use the Is Recursive feature to display the children and grand-children of parent objects. The child Flexcard can add itself to itself again and again, each time passing the same child data field (also called a data node) available in each level of the data JSON, until that data field no longer exists or is empty.

![Managed Package app icon](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/resources-global/_corporate/images/managedpackageicon.png) This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see [Omnistudio Help](https://help.salesforce.com/s/articleView?id=xcloud.os_omnistudio_standard.htm&language=en_US).

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col>
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d229785e46">
              <p style="margin-bottom:0;">Required Versions</p>
            </th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Required Versions" class="slds-cell-wrap" style="vertical-align:top;" headers="d229785e46 ">
              <p style="margin-bottom:0;">Available beginning Summer '21.</p>
            </td>

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

For example, let's say your hierarchical data JSON has a Products data field that lists products within a product. You can display the products, their child products, and grand-child products by embedding the child Flexcard once inside itself, and passing the products data field to itself. The Is Recursive features loops through each Products node and displays the product information based on the elements added to the Flexcard.

1. From the Omnistudio Flexcards home tab, create a child Flexcard. See [Embed Flexcard Inside Another Flexcard (Managed Package)](https://help.salesforce.com/s/articleView?id=xcloud.os_embed_flexcard_inside_another_flexcard.htm&release=264.0.0&type=5 "For the managed package runtime, embed a reusable Flexcard as a child inside another Flexcard. The child Flexcard can have its own data source. Or, the parent can override the child's data source with its own data source. The parent can also pass specific data to the child, such as its recordId to use as the child's contextId.").
2. Add data fields and other elements to the child Flexcard. See [Add Elements to a Flexcard (Managed Package)](https://help.salesforce.com/s/articleView?id=xcloud.os_add_elements_to_a_flexcard.htm&release=264.0.0&type=5 "For the managed package runtime, add data fields, states, actions, and other elements to your Flexcard. Style an element and configure its properties in the Flexcard Designer.").
3. From the Build panel, drag a Flexcard element onto the canvas.
4. From the Properties panel, select **Is Recursive**.
    
    You can view the actual content of a recursive child Flexcard only in preview mode. In design mode, Salesforce sometimes doesn’t show all of its elements.
5. Pass data to the children:
    
    To pass specific attributes, follow these tasks:
    
    1. In the **Attribute** field, enter a name for the attribute, such as AccountId.
    2. In the **Value** field, select a data merge field, such as {Id}.
        
        ![FlexCard Recursive Child Attributes](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/omnistudio_for_managed_packages/images/flexcard_recursive_child_attributes.png)
    3. In the data source, reference the attribute as a contextId. For example, {Parent.AccountId}.
        
        ![FlexCard Recursive Child Attributes Data Source](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/omnistudio_for_managed_packages/images/flexcard_recursive_child_attributes_ds.png)
    
    ![FlexCard Recursive Child Attributes Preview](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/omnistudio_for_managed_packages/images/flexcard_recursive_child_attributes_preview.png)
    
    To return objects within a specific dataset from the data source, enter the repeating child node in the **Data Node** field. For example, if your data source has a similar JSON structure as seen in this code sample, enter {record.Products} to display a card for each Products object.
    
    ```
    [
       {
          "Id": "5123",
          "Name": "Exit Communications",
          "Account Number": "QHT123456789",
           "Phone": "415-987-6543",
           "Website": "http://www.exitcomm.org",
           "Contact": "Melrose Oduke",
           "Contact Phone": "415-333-1234",
           "Products": [
             {
                "Id": "1",
                "Name": "Product1",
                "Products": [
                   {
                      "Id": "1_1",
                      "Name": "Product1_1"
                   },
                   {
                      "Id": "1_2",
                      "Name": "Product1_2",
                      "Products": [
                         {
                            "Id": "2",
                            "Name": "Product2",
                            "Products": [
                               {
                                  "Id": "2_1",
                                  "Name": "Product2_1"
                               },
                               {
                                  "Id": "2_1_2",
                                  "Name": "Product2_1_2"
                               }
                            ]
                         }
                      ]
                   }
                ]
             }
          ]
       }
    ]
    ```
    
    ![FlexCard Recursive Child Data Node](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/omnistudio_for_managed_packages/images/flexcard_recursive_child_data_node.png)
    
    ![FlexCard Recursive Child Data Node Preview](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/omnistudio_for_managed_packages/images/flexcard_recursive_child_data_node_preview.png)
6. (Optional) To conditionally show the recursive child Flexcard, click **+Add New** next to **Conditions** in the Properties panel. See [Add Conditions to a Flexcard Element (Managed Package)](https://help.salesforce.com/s/articleView?id=xcloud.os_add_conditions_to_a_flexcard_element.htm&release=264.0.0&type=5 "For the managed package runtime, display or hide data based on the value of a data field. For example, display an alert icon or supplemental text for escalated Cases. Apply conditions to any element listed in the Build panel of the Flexcard Designer.").
    
    Conditions applied to a recursive child Flexcard, apply to all recursively repeating records. If one record condition returns false, nested records don't show.
7. To preview the Flexcard at run time, click **Preview**.
8. Click **Activate**.
    
    ![Important](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/images/icon_important.png)
    
    Important Activate the child Flexcard to embed it into a parent Flexcard.