# Set Content in Data Design

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

Available in: Page Flow

Toolbox Category: Dynamic Content

Block Type: [Regular](https://docs.zingy.ai/app-editor/block-anatomy#regular-block)
{% endhint %}

**`Set Content in Data Design`** is a [regular block](https://docs.zingy.ai/app-editor/block-anatomy#regular-block) that allows you to set the content of 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.

<div align="left"><figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2FITKpSggIzQb9cc87nolU%2Fimage.png?alt=media&#x26;token=810bcfda-a6d7-4447-9b5e-d12c9ff98569" alt="" width="266"><figcaption><p>Set Content in Data Design block</p></figcaption></figure></div>

The behavior of the block is similar to the [Set Content](https://docs.zingy.ai/app-editor/page-flow/toolbox-blocks/set-content) 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):

* *Behavior*: [Dropdown configuration setting](https://docs.zingy.ai/app-editor/block-anatomy#dropdown) that allows you to choose from three options:
  1. Set: Overwrite the contents of the chosen *Element* with *Content* provided.
  2. Append: Add the *Content* provided to the existing content of the chosen *Element*.
  3. Prepend: Add the *Content* provided before any existing content of the chosen *Element*.&#x20;
* *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 change the content of.
* *ID*: 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 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. See below for more details.
* *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.
* *Content*: [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 containing the content you want to set.

***

## ID and ID2 usage

The behavior of this block depends on the ID and ID2 [value parameters](https://docs.zingy.ai/app-editor/block-anatomy#value-parameters) and is detailed below:

* ID and ID2 not provided: Operate on the selected element for all generated instances of the same [Data Design](https://docs.zingy.ai/app-editor/page-editor/built-in-elements/data-design) element.
* ID2 provided and ID not provided: Operate on the selected element for all generated instances of the same [Data Design](https://docs.zingy.ai/app-editor/page-editor/built-in-elements/data-design) element with the same ID2 value.
* ID provided and ID2 not provided: Operate on the selected element for all generated instances of the same [Data Design](https://docs.zingy.ai/app-editor/page-editor/built-in-elements/data-design) element with the same ID value. Since we recommend the ID value to be unique, this would choose one from all the generated instances of the associated [Data Design](https://docs.zingy.ai/app-editor/page-editor/built-in-elements/data-design) element.
* ID and ID2 provided: Operate on the selected element for all generated instances of the same [Data Design](https://docs.zingy.ai/app-editor/page-editor/built-in-elements/data-design) element with the same ID  and ID2 value.&#x20;

***

## Usage Examples

{% 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 content of the [Text](https://docs.zingy.ai/app-editor/page-editor/editing-text) element that displays the current stock price (*Text460*) is set to *123.4* for Company 2, which is rendered with the ID *ST101* .&#x20;

<div align="left"><figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2F5QlcidAzZE72agEX6FZL%2Fimage.png?alt=media&#x26;token=42abf9e2-ae62-4fc8-b492-1502fe006f44" alt="" width="520"><figcaption><p>Example 1 of Set Content in Data Design block</p></figcaption></figure></div>

The result of the above example is highlighted below, where the stock price for Company 2 is displayed with the value we set.

<figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2FcCYQnw63uBFGpeqjH3KL%2Fimage.png?alt=media&#x26;token=6b107a65-e9d9-4701-9f4e-708b9e69863d" alt=""><figcaption><p>Result of the example 1</p></figcaption></figure>

In the second example, we will demonstrate the case where neither ID nor ID2 are provided. In this scenario, the system will set the content of the [Text](https://docs.zingy.ai/app-editor/page-editor/editing-text) element (*Text460*) for all generated instances of the selected Data Design element.

<div align="left"><figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2FymxztrdIvMxTAmWUfcBh%2Fimage.png?alt=media&#x26;token=1fa432f0-4c85-46ce-8f84-df0025e26abd" alt="" width="547"><figcaption><p>Example 2 of Set Content in Data Design block</p></figcaption></figure></div>

In the above image the ID and ID2 value parameters are left blank and the Content value parameter is set to the text "Loading...: .

The result of the above example is highlighted below where the [Text](https://docs.zingy.ai/app-editor/page-editor/editing-text) element showing the stock price of both companies says "Loading..."

<figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2FgPgDgtIj56crQq39nx0M%2Fimage.png?alt=media&#x26;token=919b9021-2f09-4aa3-aa33-791f4ab6318d" alt=""><figcaption><p>Result of the example 2</p></figcaption></figure>
