# Get Element Attribute in Data Design

{% hint style="info" %}
**Block Information**

Available in: Page Flow

Toolbox Category: Dynamic Content

Block Type: [Output](https://docs.zingy.ai/app-editor/block-anatomy#output-block)

Output Type: [*text*](https://docs.zingy.ai/app-editor/page-flow/references/value-types)
{% endhint %}

**`Get Element Attribute in Data Design`** is an [output block](https://docs.zingy.ai/app-editor/block-anatomy#output-block) that allows you to retrieve the value of any [HTML attribute](https://en.wikipedia.org/wiki/HTML_attribute) in elements that were generated using the [Content from Data Design](https://docs.zingy.ai/app-editor/page-flow/toolbox-blocks/content-from-data-design) block and dynamically added to the page or form.

The output is of type [*text*](https://docs.zingy.ai/app-editor/page-flow/references/value-types) and is compatible with [Value Parameters](https://docs.zingy.ai/app-editor/block-anatomy#value-parameters) of type [*text*](https://docs.zingy.ai/app-editor/page-flow/references/value-types) or of type [*any*](https://docs.zingy.ai/app-editor/page-flow/references/value-types).

<div align="left"><figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2FxhNcU1ySn9bELq0kwqVb%2Fimage.png?alt=media&#x26;token=b85be877-2ad8-4df9-a29d-28c7fd299f90" alt="" width="285"><figcaption><p>Get Element Attribute in Data Design block</p></figcaption></figure></div>

The behavior of the block is similar to the [Get Element Attribute](https://docs.zingy.ai/app-editor/page-flow/toolbox-blocks/get-element-attribute) block, with some important differences:

* Element Selection: You can only choose an element placed inside the selected [Data Design](https://docs.zingy.ai/app-editor/page-editor/built-in-elements/data-design) element.
* Works only with elements generated using [Content from Data Design](https://docs.zingy.ai/app-editor/page-flow/toolbox-blocks/content-from-data-design) block that are dynamically added.

The block consists of the following (from top to bottom):

* *Attribute*: [Value Parameter](https://docs.zingy.ai/app-editor/block-anatomy#value-parameters) that accepts a [*text*](https://docs.zingy.ai/app-editor/page-flow/references/value-types) value representing the [HTML attribute](https://en.wikipedia.org/wiki/HTML_attribute) to set or change the value of.
* *Data Design*: [Selectable Input](https://docs.zingy.ai/app-editor/block-anatomy#selectable-input) to choose the [Data Design](https://docs.zingy.ai/app-editor/page-editor/built-in-elements/data-design) element whose element you want to target.
* *Element*: [Selectable Input](https://docs.zingy.ai/app-editor/block-anatomy#selectable-input) to choose the element, within the selected [Data Design](https://docs.zingy.ai/app-editor/page-editor/built-in-elements/data-design), you want to get the attribute of.
* *ID*: Mandatory [Value Parameter](https://docs.zingy.ai/app-editor/block-anatomy#value-parameters) that accepts a [*text*](https://docs.zingy.ai/app-editor/page-flow/references/value-types) value representing the unique value that was provided to the [Content from Data Design](https://docs.zingy.ai/app-editor/page-flow/toolbox-blocks/content-from-data-design) block.
* *ID2*: Optional [Value Parameter](https://docs.zingy.ai/app-editor/block-anatomy#value-parameters) that accepts a [*text*](https://docs.zingy.ai/app-editor/page-flow/references/value-types) value representing the secondary identifier that can be used to identify the desired element. See below for more details.

***

## Usage Example

{% hint style="info" %}
**NOTE: Please refer to the prerequisite information shown** [**here**](https://docs.zingy.ai/app-editor/page-flow/references/prerequisite-for-dynamic-content-block-examples) **before seeing the example.**&#x20;
{% endhint %}

The image below shows an example in which the variable *a* is set to the value of the [href](https://docs.zingy.ai/page-editor/built-in-elements/link#href) attribute of the [Link](https://docs.zingy.ai/app-editor/page-editor/built-in-elements/link) element (Company Link) within the selected [Data Design](https://docs.zingy.ai/app-editor/page-editor/built-in-elements/data-design) element.

<figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2F2Jr5o8tC3MdGXJ5tGRyH%2Fimage.png?alt=media&#x26;token=078363e2-0891-4af0-875f-7b95f224a316" alt=""><figcaption><p>Example of Get Element Attribute in Data Design block</p></figcaption></figure>

The above example will result in the variable *a* being set to ***`https://company2.com`*** (the URL of Company 2).
