HostAppDataSource

For a `https://developers.google.com/apps-script/reference/card-service/selection-input` widget that uses a multiselect menu, a data source from a Google
Workspace application. The data source populates selection items for the multiselect menu.

```javascript
const chatSpaceDataSource =
    CardService.newChatSpaceDataSource().setDefaultToCurrentSpace(true);

const chatClientDataSource =
    CardService.newChatClientDataSource().setSpaceDataSource(
        chatSpaceDataSource);

const hostAppDataSource =
    CardService.newHostAppDataSource().setChatDataSource(chatClientDataSource);
```

Only available for Google Chat apps and Google Workspace add-ons that extend flows. Not
available for other Google Workspace add-ons.

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/card-service/host-app-data-source#setChatDataSource(ChatClientDataSource)` | `https://developers.google.com/apps-script/reference/card-service/host-app-data-source#` | Sets the data source from Google Chat. |
| `https://developers.google.com/apps-script/reference/card-service/host-app-data-source#setWorkflowDataSource(WorkflowDataSource)` | `https://developers.google.com/apps-script/reference/card-service/host-app-data-source#` | Sets the data source from Google Workspace Flows. |

## Detailed documentation

### `setChatDataSource(chatClientDataSource)`

Sets the data source from Google Chat.

```javascript
const chatSpaceDataSource =
    CardService.newChatSpaceDataSource().setDefaultToCurrentSpace(true);

const chatClientDataSource =
    CardService.newChatClientDataSource().setSpaceDataSource(
        chatSpaceDataSource);

const hostAppDataSource =
    CardService.newHostAppDataSource().setChatDataSource(chatClientDataSource);
```
Only available for Google Chat apps. Not available for Google Workspace add-ons.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `chatClientDataSource` | `https://developers.google.com/apps-script/reference/card-service/chat-client-data-source` | The data source to be set. |

#### Return


`https://developers.google.com/apps-script/reference/card-service/host-app-data-source#` --- This object, for chaining.

*** ** * ** ***

### `setWorkflowDataSource(workflowDataSource)`

Sets the data source from Google Workspace Flows.

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

```javascript
const workflowDataSource =
    CardService.newWorkflowDataSource().setIncludeVariables(true);

const hostAppDataSource =
    CardService.newHostAppDataSource().setWorkflowDataSource(workflowDataSource);
```

#### Parameters

| Name | Type | Description |
|---|---|---|
| `workflowDataSource` | `https://developers.google.com/apps-script/reference/card-service/workflow-data-source` | The data source to be set. |

#### Return


`https://developers.google.com/apps-script/reference/card-service/host-app-data-source#` --- This object, for chaining.