Condition

A condition used to run an event action as part of [CEL
expression validation](https://developers.google.com/workspace/add-ons/studio/validate-inputs#cel-validation).

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

```javascript
const condition = CardService.newCondition().setActionRuleId("CEL_TEXTBOX_SUCCESS_RULE_ID")
.setExpressionDataCondition(CardService.newExpressionDataCondition()
.setConditionType(CardService.ExpressionDataConditionType.EXPRESSION_EVALUATION_SUCCESS));
```

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/card-service/condition#setActionRuleId(String)` | `https://developers.google.com/apps-script/reference/card-service/condition#` | The unique ID of the action rule to run in response to the condition. |
| `https://developers.google.com/apps-script/reference/card-service/condition#setExpressionDataCondition(ExpressionDataCondition)` | `https://developers.google.com/apps-script/reference/card-service/condition#` | Sets the [CEL expression validation](https://developers.google.com/workspace/add-ons/studio/validate-inputs#cel-validation) condition used to determine whether the event action should run. |

## Detailed documentation

### `setActionRuleId(actionRuleId)`

The unique ID of the action rule to run in response to the condition.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `actionRuleId` | `String` | The ID that uniquely identifies an event action. |

#### Return


`https://developers.google.com/apps-script/reference/card-service/condition#` --- This Condition object, for chaining.

*** ** * ** ***

### `setExpressionDataCondition(expressionDataCondition)`

Sets the [CEL
expression validation](https://developers.google.com/workspace/add-ons/studio/validate-inputs#cel-validation) condition used to determine whether the event action should run.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `expressionDataCondition` | `https://developers.google.com/apps-script/reference/card-service/expression-data-condition` | A expression data condition. |

#### Return


`https://developers.google.com/apps-script/reference/card-service/condition#` --- The Condition object, for chaining.