# Set Input Value in Data Design

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

Available in: Page Flow

Toolbox Category: Dynamic Input

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

**`Set Input Value in Data Design`** is a [regular block](https://docs.zingy.ai/app-editor/block-anatomy#regular-block) that allows you to set the value of [Input](https://docs.zingy.ai/app-editor/page-editor/built-in-elements/input), [Dropdown](https://docs.zingy.ai/app-editor/page-editor/built-in-elements/dropdown) and [Multi-line](https://docs.zingy.ai/app-editor/page-editor/built-in-elements/multi-line) 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%2FpseHSx1BIshSw0XHUgvX%2Fimage.png?alt=media&#x26;token=5fa73ea8-3979-4dc5-acba-1eb263d7b288" alt="" width="272"><figcaption><p>Set Input Value in Data Design block</p></figcaption></figure></div>

The behavior of the block is similar to the [Set Input Value](https://docs.zingy.ai/app-editor/page-flow/toolbox-blocks/set-input-value) block, with some important differences:

* 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.
* 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.

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

* *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 set the value 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.
* *Data*: [Value Parameter](https://docs.zingy.ai/app-editor/block-anatomy#value-parameters) that accepts the value to set (of type [*text*](https://docs.zingy.ai/app-editor/page-flow/references/value-types)*)*

***

## 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 [Input](https://docs.zingy.ai/app-editor/page-editor/built-in-elements/input) element (*Input43*) for the owned quantity is set to the value of variable *b* (which has the value of *50*) for Company 1, which as rendered with the ID *ST100* .

<div align="left"><figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2FqfFA9jek1A5uXkS3eGm4%2Fimage.png?alt=media&#x26;token=1f6c54f7-a739-4084-b87e-3ac9b92cadec" alt="" width="518"><figcaption><p>Set Input Value in Data Design block example 1</p></figcaption></figure></div>

The result of the above example is highlighted below, where the owned quantity [Input](https://docs.zingy.ai/app-editor/page-editor/built-in-elements/input) element (*Input43*) is filled with the value *50* for Company 1.

<figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2Fe7Mnx5ANfQx0Ul1YN2ZP%2Fimage.png?alt=media&#x26;token=07605713-6e72-441b-9c01-c46460a88862" alt=""><figcaption><p>Result of example 1</p></figcaption></figure>

In the second example, we will demonstrate the scenario where neither ID nor ID2 are provided. In this case, the system will populate the owned quantity [Input](https://docs.zingy.ai/app-editor/page-editor/built-in-elements/input) element (*Input43*) for all generated instances.

<div align="left"><figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2F3dxC8SK5ezL2TxBbnczX%2Fimage.png?alt=media&#x26;token=f129acf3-9726-4b48-82da-29e20e0826a1" alt="" width="463"><figcaption><p>Set Input Value in Data Design block example 2</p></figcaption></figure></div>

The result of the above example is highlighted below where the owned quantity [Input](https://docs.zingy.ai/app-editor/page-editor/built-in-elements/input) element (*Input43*) is filled with *0* for both the companies.

<figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2Fw95mBa1ISxOBl5zrQ4kS%2Fimage.png?alt=media&#x26;token=ae05db36-c38d-4cdd-b595-857b75b6111a" alt=""><figcaption><p>Result of example 2</p></figcaption></figure>
