# Initialize Toggle Switch in Data Design

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

Available in: Page Flow

Toolbox Category: Dynamic Input

Block Type: [Regular](/app-editor/page-flow/block-anatomy.md#regular-block)
{% endhint %}

**`Initialize Toggle Switch in Data Design`** is a [regular block](/app-editor/page-flow/block-anatomy.md#regular-block) that is used to initialize [Checkbox](/app-editor/page-editor/built-in-elements/checkbox.md) and [Toggle Switch](/app-editor/page-editor/built-in-elements/toggle-switch.md) elements that were generated using the [Content from Data Design](/app-editor/page-flow/toolbox-blocks/content-from-data-design.md) block and dynamically added to the page or form.

<div align="left"><figure><img src="/files/HAtxV8orbIbsDztBEC1A" alt="" width="343"><figcaption><p>Initialize Toggle Switch in Data Design block</p></figcaption></figure></div>

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

* *Data Design*: [Selectable Input](/app-editor/page-flow/block-anatomy.md#selectable-input) to choose the [Data Design](/app-editor/page-editor/built-in-elements/data-design.md) element whose element you want to target.
* *Element*: [Selectable Input](/app-editor/page-flow/block-anatomy.md#selectable-input) to choose  [Checkbox](/app-editor/page-editor/built-in-elements/checkbox.md) / [Toggle Switch](/app-editor/page-editor/built-in-elements/toggle-switch.md) elements, within the selected [Data Design](/app-editor/page-editor/built-in-elements/data-design.md), you want to initialize.
* *ID*: Optional [Value Parameter](/app-editor/page-flow/block-anatomy.md#value-parameters) that accepts a [*text*](/app-editor/page-flow/references/value-types.md) value representing the unique value that was provided to the [Content from Data Design](/app-editor/page-flow/toolbox-blocks/content-from-data-design.md) block. See below for more details.
* *ID2*: Optional [Value Parameter](/app-editor/page-flow/block-anatomy.md#value-parameters) that accepts a [*text*](/app-editor/page-flow/references/value-types.md) value representing the secondary identifier that can be used to identify the desired element. See below for more details.

{% hint style="success" %}
NOTE: For the most common use cases, the ID and ID2 values need to be blank when using the **`Initialize Toggle Switch in Data Design`** block.
{% endhint %}

***

## ID and ID2 usage

The behavior of this block depends on the ID and ID2 [value parameters](/app-editor/page-flow/block-anatomy.md#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](/app-editor/page-editor/built-in-elements/data-design.md) element.
* ID2 provided and ID not provided: Operate on the selected element for all generated instances of the same [Data Design](/app-editor/page-editor/built-in-elements/data-design.md) 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](/app-editor/page-editor/built-in-elements/data-design.md) 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](/app-editor/page-editor/built-in-elements/data-design.md) element.
* ID and ID2 provided: Operate on the selected element for all generated instances of the same [Data Design](/app-editor/page-editor/built-in-elements/data-design.md) element with the same ID  and ID2 value.

***

## Usage Example

<div align="left"><figure><img src="/files/BwHJegzpET76VjQ6RKQ1" alt="" width="503"><figcaption><p>Initialize Toggle Switch in Data Design example</p></figcaption></figure></div>

{% hint style="success" %}
NOTE: The same example also applies for a [Checkbox](/app-editor/page-editor/built-in-elements/checkbox.md) element.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.zingy.ai/app-editor/page-flow/toolbox-blocks/initialize-toggle-switch-in-data-design.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
