---
category: [Administration & Integrations, Platform and Product Extensions, Platform and Product Extensions/Integration, Administration & Integrations/Custom Integrations & Apps, Platform and Product Extensions/Workday Extend]
keyword: [Extend, Presentation Components, widgets, tags, UI components]
nav: wcp_docs
parent_url: /wcp_docs/
title: dynamicSection
layout: subsection
wd_wcptag: dynamicSection
---

<a id="section_N1005A_N10057_N10001"></a>
A group of related widgets that can refresh dynamically based on the data you pass in. Some sample use cases of `dynamicSection` include:

-   Re-render a chart by changing the data source.
-   Re-render a `grid` with different columns.
-   Update `button` task parameter bindings.
-   Update `loop` with dynamic data.
-   Update the `pageActionButton` label.


Use `dynamicSection` on edit pages only.

<b>Note:</b> `dynamicSection` must be a child of a `section` or `fieldSet`.

## <a id="section_usage"></a>Usage

See [Concept: dynamicSection](/wcp_docs/pbe1680029528196.html).

## <a id="section_wdl_3wy_ywb"></a>Example

In this example, placing the `pageActionButton` tag in a `dynamicSection` enables the user to update the button `label` by entering a new value into the `newLabel` `text` widget.

```
"body": {
 "type": "section",
 "children": [
   {
     "type": "dropdown",
     "id": "newLabel",
     "label": "Select a new label for Action Button:",
     "instanceList": [
       {
         "id": "label1",
         "descriptor": "Label 1"
       },
       {
         "id": "label2",
         "descriptor": "Label 2"
       }
     ],
     "onChange": "<%
        dynamicButtonLabel.data = self.selectedEntries[0].descriptor ?? 'Action Button';  
      %>"
   },
   {
     "type": "dynamicSection",
     "id": "dynamicButtonLabel",
     "data": "<% '' %>",
     "dataVariableName": "buttonLabel",
     "children": [
       {
         "type": "pageActionButton",
         "id": "dynamicButton",
         "label": "<% buttonLabel ?: 'Action Button' %>",
         "onClick": "<%  %>"
       }
     ]
   }
 ]
}
```

The `onChange` event on the `text` widget passes user input data into the `data` attribute of `dynamicSection`. `dynamicSection` then passes the user input data into the `label` of its child widget, which is `pageActionButton`.

## <a id="section-mobile-support"></a>Mobile Support

Android, iOS

## <a id="section_bpl_pfq_ywb"></a>Attributes

-   <b>data</b>

    Data type: objectScript

    A script to return a data object.

    `dynamicSection` passes the data object to its child tags. You can dynamically update `data` using PMD scripting.

-   <b>dataVariableName</b>

    Data type: string

    The variable name you use to reference `data` in child tags.

-   <b>children</b>

    Data type: list of tags

    An array of tags that belong to this parent tag.

-   <b>id</b>

    Data type: binding-String

    Unique identifier used to reference this widget from other tags.

    Notes:

    -   The `id` must start with a letter.
    -   The `id` must be unique per page.
    -   To enable other widgets to reference this widget `id`, place this widget before the other widgets on the PMD. The PMD validation returns an "Undefined variable" error if it doesn't find a previously defined `id` in the PMD.
    -   Workday recommends that you include the `id` in your tag definitions for debugging purposes.

-   <b>render</b>

    Data type: booleanScript

    If true, this tag renders as a widget on the page. If false, the loaded page doesn't add this tag or its children. The default is true.

    Unlike the `visible` attribute, when `render` is false, other tags on the page can't reference this tag or widget on edit pages. On view pages, a tag can't reference other tags regardless of the `render` attribute value.

-   <b>visible</b>

    Data type: booleanScript

    If true, the widget generated by this tag is visible. If false, this tag and its children tags aren't visible. This tag provides the ability to display or hide the widget dynamically based on user interactions on the page. The default is true. Unlike the `render` attribute, the generated widget persists on the page even when `visible` is false.

    <b>Notes:</b>

    -   When the widget or field you’re hiding changes on the page, you must include it inside a `fieldSet`.
    -   When the `visible` attribute is false for this widget on an edit page, the outbound endpoint doesn't include the `valueOutBinding` or `valuesOut` data of the widget in the payload. To include the `valueOutBinding` or `valuesOut` data in the payload, use the `onSend` event handler.



## <a id="section_pmdScriptingMethods"></a>PMD Scripting Methods

-   <a id="d33e1308"></a><b>get(String childId)</b>

    Return type: `Widget`

    Description: Returns the child widget with the specified tag `id` inside this container. The `get(childId)` method enables you to directly access the children of the `dynamicSection` widget.

    Different ways to call the `get(childId)` method:

    -   <i>container</i>.<i>childId</i>

        Example

        ```
        mydynamicSection.textField.value = self.value;
        ```

    -   <i>container</i>['<i>childId</i> ']

        Example

        ```
        mydynamicSection['textField'].value = self.value;
        ```

    -   <i>container</i>.get('<i>childId</i> ')

        Example

        ```
        mydynamicSection.get('textField').value = self.value;
        ```


-   <a id="d33e1386"></a><b>getChildrenMap()</b>

    Return type: `Map`

    Description: Returns a map containing all children of this container widget. The keys in the map are the ids of the children tags.

-   <b>setData(newDataObject)</b>

    Return type: None

    Description: Updates the data used by the child tags in this container widget. Use `setData(newDataObject)` during user interaction with the page after it loads. Example:

    ```
    "onChange" : "<% myDynamicSection.setData(self.value) %>"
    ```

    In this example, `myDynamicSection.setData(self.value)` is equivalent to `myDynamicSection.data = self.value`.



