UpdateMessageAction

The Chat app updates text or cards in a message. For details, see [Send Google Chat
messages](https://developers.google.com/workspace/add-ons/chat/send-messages).

Available for Google Workspace add-ons that extend Google Chat.

```javascript
const card = CardService.newCardBuilder()
    .setHeader(CardService.newCardHeader().setTitle("Card Title"))
    .addSection(CardService.newCardSection()
      .addWidget(CardService.newTextParagraph().setText("Text paragraph")))
    .build();

const cardWithId = CardService.newCardWithId().setCardId("card_one").setCard(card);

const message = AddOnsResponseService.newChatMessage().addCardWithId(cardWithId);

const chatDataAction = AddOnsResponseService.newChatDataActionBuilder()
    .setUpdateChatMessageAction(AddOnsResponseService.newUpdateMessageAction()
    .setMessage(message))
    .build();
```

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/add-ons-response-service/update-message-action#setMessage(ChatMessage)` | `https://developers.google.com/apps-script/reference/add-ons-response-service/update-message-action#` | Sets the message for this action. |

## Detailed documentation

### `setMessage(message)`

Sets the message for this action.

```javascript
const card = CardService.newCardBuilder()
    .setHeader(CardService.newCardHeader().setTitle("Card Title"))
    .addSection(CardService.newCardSection()
      .addWidget(CardService.newTextParagraph().setText("Text paragraph")))
    .build();

const cardWithId = CardService.newCardWithId().setCardId("card_one").setCard(card);

const message = AddOnsResponseService.newChatMessage().addCardWithId(cardWithId);

const chatDataAction = AddOnsResponseService.newChatDataActionBuilder()
    .setUpdateChatMessageAction(AddOnsResponseService.newUpdateMessageAction()
    .setMessage(message))
    .build();
```

#### Parameters

| Name | Type | Description |
|---|---|---|
| `message` | `https://developers.google.com/apps-script/reference/add-ons-response-service/chat-message` | The chat message to update. |

#### Return


`https://developers.google.com/apps-script/reference/add-ons-response-service/update-message-action#` --- This object, for chaining.