> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omni.co/llms.txt
> Use this file to discover all available pages before exploring further.

# app:control-changed embed event

> Emitted by Omni when the value of a document control on an embedded app changes.

Emitted by Omni when the value of one or more document controls on an embedded [app](https://docs.omni.co/visualize-present/apps) changes after the app loads.

Use this to keep your own interface in sync with an app's document controls.

## Payload

```json theme={null}
{
  "name": "app:control-changed",
  "payload": {
    "controls": {},
    "changed": []
  }
}
```

## Properties

**controls** `object`

Each document control's value after the change, as an object of control ID to value, in the same shape `omni.controls` reports. The control values Omni reports when the app first loads are the baseline and aren't reported as a change.

**changed** `array`

What differs from the previous values. One entry per changed control.

**changed properties**

**id** `string`

The ID of the control that changed.

**action** `string`

The type of change:

* `added` - A value was set on a control that didn't previously have one
* `removed` - An existing control's value was removed
* `updated` - An existing control's value changed

**prev** `object`

The previous control value, in the same shape as `controls`. Absent when `action` is `added`.

**next** `object`

The new control value, in the same shape as `controls`. Absent when `action` is `removed`.

## Example

Someone picks **Levi** in an app's brand control:

```json theme={null}
{
  "name": "app:control-changed",
  "payload": {
    "controls": {
      "brand": { "type": "string", "values": ["Levi"] }
    },
    "changed": [
      {
        "id": "brand",
        "action": "updated",
        "prev": { "type": "string", "values": ["Wrangler"] },
        "next": { "type": "string", "values": ["Levi"] }
      }
    ]
  }
}
```

A value from `controls` can be sent back in [`app:set-controls`](https://docs.omni.co/embed/events/app-set-controls) as-is.

Refer to [Consuming events](https://docs.omni.co/embed/events/consume.md) for the full listener setup, including origin checks.
