# Executing Do Block On Checkbox Change

> You can configure activities inside the **Do** block to execute when a specific checkbox in the form is checked or unchecked.

You can configure activities inside the **Do** block to execute when a specific checkbox in the form is checked or unchecked.

## Tutorial

To use this feature:

1. Add the **Create Form** activity to your workflow.
2. Inside the **Do** block, configure the desired activities.
3. Open the Form Designer from the **Create Form** activity.
4. Drag and drop a **Checkbox** component.
5. In the **Data** tab, click ** Calculated Value**. This expands a list of fields.
6. In the **JavaScript** field, enter the following JavaScript code:
   ```
   const updateOnChange = instance.updateOnChange;
       instance.updateOnChange = function(flags, changed) {
             if (flags.modified) {
              instance.emit('execute', instance.component.key , {});
             }
   }
   ```

   :::note
   The code snippet above triggers the execution of the activities from the **Do** block based on the checkbox change.
   :::

7. Save the form.
8. At runtime, when you make changes to the checkbox, notice the activities in the **Do** block being executed.

**Result**

When you select the **Checkbox** component, the **Do** block executes. For this example, when you select the **Checkbox** component, a Message Box pops up.

  <iframe
    src="https://documentationpicturerepo.blob.core.windows.net/screenshots/screenshots/_Action_Center/Cloud/checkbox_change.mp4"
    title="Accelerate building automations with UiPath Integration Service"
    style={{
      position: "absolute",
      top: 0,
      left: 0,
      width: "100%",
      height: "100%",
      border: 0,
    }}
    loading="lazy"
    allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
    referrerPolicy="strict-origin-when-cross-origin"
    allowFullScreen
  ></iframe>

:::important
**Known issue**: The **Do** block executes twice: when you select the **Checkbox** component and when you submit the form.
:::

## Sample workflow

To check the complete workflow or to have a future reference, download the [XAML example](https://documentationexamplerepo.blob.core.windows.net/examples/Forms/ExecutingDoBlockOnCheckboxChange_workaround.xaml)
