# Event Actions

Event actions allow event providers to specify the intent of the operation for which the event is being raised. This can be picked up by consumers of the event and processed accordingly.&#x20;

## Standard Actions

Standard actions in the WireBootstrap data event system are centered around keeping data selections in sync among the components displaying data on a page.

In the example below, the event is telling consumers that the `product` `SKU001` was selected and should `replace` the product value in any data set or query on the page.

```javascript
const dataevent = new wire.data.DataEvent()
    .dataselect()
    .action().replace()
    .cell("product", "SKU001")
    .raise();
```

With standard data events, `replace` is the default action.  If no action is specified, consumers should consider the data event a `replace` action.

Other standard actions include `add` which tells consumers to add the cell value to a query or data set,  `remove` which will remove the cell value from a dataset or query, and `clear` which clears the selections all together for the column, `product` in this example.&#x20;

```javascript
...

ev.action().add();
 
ev.action().remove();
 
ev.action().clear();      

...
```

## Custom Actions

In the example below, an event is raised telling listeners that data has been selected and that the data should be passed to an external system via a custom link.  Consumers of this event would need to be programmed to process the link based on the data and the action

```javascript
const dataevent = new wire.data.DataEvent()
    .dataselect()
    .action("link")
    .data( { url: "https://somesite?product=SKU001" } )
    .raise();
```


---

# 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.wirebootstrap.com/wirebootstrap/data-events/event-actions.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.
