EventAction

An EventAction to run when a [CEL
expression validation](https://developers.google.com/workspace/add-ons/studio/validate-inputs#cel-validation) condition is met.

Only available for Google Workspace add-ons that extend Google Workspace Studio.

```javascript
const eventAction = CardService.newEventAction().setActionRuleId("CEL_TEXTBOX_EVALUATION_RULE_ID")
.setExpressionDataAction(expressionDataAction)
.addPostEventTrigger(trigger_success)
.addPostEventTrigger(trigger_failure);
```

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/card-service/event-action#addPostEventTrigger(Trigger)` | `https://developers.google.com/apps-script/reference/card-service/event-action#` | Adds a [CEL expression validation](https://developers.google.com/workspace/add-ons/studio/validate-inputs#cel-validation) condition to evaluate after the event action runs. |
| `https://developers.google.com/apps-script/reference/card-service/event-action#setActionRuleId(String)` | `https://developers.google.com/apps-script/reference/card-service/event-action#` | Sets a unique identifier for the event action. |
| `https://developers.google.com/apps-script/reference/card-service/event-action#setCommonWidgetAction(CommonWidgetAction)` | `https://developers.google.com/apps-script/reference/card-service/event-action#` | Set the common widget action for widgets. |
| `https://developers.google.com/apps-script/reference/card-service/event-action#setExpressionDataAction(ExpressionDataAction)` | `https://developers.google.com/apps-script/reference/card-service/event-action#` | Sets the [CEL expression validation](https://developers.google.com/workspace/add-ons/studio/validate-inputs#cel-validation) data action for widgets. |

## Detailed documentation

### `addPostEventTrigger(trigger)`

Adds a [CEL
expression validation](https://developers.google.com/workspace/add-ons/studio/validate-inputs#cel-validation) condition to evaluate after the event action runs.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `trigger` | `https://developers.google.com/apps-script/reference/card-service/trigger` | The CEL expression validation trigger to add. |

#### Return


`https://developers.google.com/apps-script/reference/card-service/event-action#` --- The EventAction, for chaining.

*** ** * ** ***

### `setActionRuleId(actionRuleId)`

Sets a unique identifier for the event action.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `actionRuleId` | `String` | The unique identifier for the action rule. |

#### Return


`https://developers.google.com/apps-script/reference/card-service/event-action#` --- The EventAction, for chaining.

*** ** * ** ***

### `setCommonWidgetAction(commonWidgetAction)`

Set the common widget action for widgets.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `commonWidgetAction` | `https://developers.google.com/apps-script/reference/card-service/common-widget-action` | The common widget action. |

#### Return


`https://developers.google.com/apps-script/reference/card-service/event-action#` --- The EventAction, for chaining.

*** ** * ** ***

### `setExpressionDataAction(expressionDataAction)`

Sets the [CEL
expression validation](https://developers.google.com/workspace/add-ons/studio/validate-inputs#cel-validation) data action for widgets.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `expressionDataAction` | `https://developers.google.com/apps-script/reference/card-service/expression-data-action` | The expression data action. |

#### Return


`https://developers.google.com/apps-script/reference/card-service/event-action#` --- The EventAction, for chaining.