# emit

BetterForms uses an internal event bus for communication between various elements. This allows parents, children and peers to all send information without direct references.

the `emit` action emits a message to elements that may be listening via this internal event bus.

## Emit Action Object

| Key               | value              | Description                                                                                     |
| ----------------- | ------------------ | ----------------------------------------------------------------------------------------------- |
| action            | 'emit'             | Action name                                                                                     |
| options.eventName | {string}           | The name of the event used to target the listener                                               |
| options.message   | {string \| object} | The message body object, can be any type of data, see the elements specific fields it requires. |

**Uses:**

General purpose event communication between elements.

**Example**

```yaml
// This will send the seating chart element a reset to home screen commands 
[
  {
    "action": "emit",
    "options": {
      "eventName": "d3sc",
      "message": {
         "data": "",     // this data varies depending on the receiving element
         "method": "goToBoard"
      }
    }
  }
  ...

]
```


---

# 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.klai.studio/reference/actions-processor/actions_overview/emit.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.
