다중 선택 메뉴를 사용하는 Selection 위젯의 경우 Google Workspace의 데이터 소스 다중 선택 메뉴의 항목을 채우는 데 사용됩니다.
const platformDataSource = CardService.newPlatformDataSource().setCommonDataSource( CardService.CommonDataSource.USER, ); const multiSelect = CardService.newSelectionInput() .setType(CardService.SelectionInputType.MULTI_SELECT) .setFieldName('contacts') .setTitle('Selected contacts') .setMultiSelectMaxSelectedItems(5) .setMultiSelectMinQueryLength(1) .setPlatformDataSource(platformDataSource);
Google Chat 앱에서만 사용할 수 있습니다. Google Workspace 부가기능에는 사용할 수 없습니다.
메서드
| 메서드 | 반환 유형 | 간략한 설명 |
|---|---|---|
set | Platform | Google Workspace의 데이터 소스를 설정합니다. |
set | Platform | Google Workspace에서 드라이브 데이터 소스 사양을 설정합니다. |
set | Platform | 다중 선택 메뉴에서 스페이스를 채우는 데 사용됩니다. |
자세한 문서
set Common Data Source(commonDataSource)
Google Workspace의 데이터 소스를 설정합니다.
const platformDataSource = CardService.newPlatformDataSource().setCommonDataSource( CardService.CommonDataSource.USER, ); const multiSelect = CardService.newSelectionInput() .setType(CardService.SelectionInputType.MULTI_SELECT) .setFieldName('contacts') .setTitle('Selected contacts') .setMultiSelectMaxSelectedItems(5) .setMultiSelectMinQueryLength(1) .setPlatformDataSource(platformDataSource);
매개변수
| 이름 | 유형 | 설명 |
|---|---|---|
common | Common | 설정할 데이터 소스입니다. |
리턴
Platform - 연결을 위한 이 객체
set Drive Data Source Spec(driveDataSourceSpec)
Google Workspace에서 드라이브 데이터 소스 사양을 설정합니다.
const driveDataSourceSpec = CardService.newDriveDataSourceSpec() .addItemType(CardService.DriveItemType.DOCUMENTS) .addItemType(CardService.DriveItemType.FORMS); const platformDataSource = CardService.newPlatformDataSource().setCommonDataSource( CardService.CommonDataSource.DRIVE ).setDriveDataSourceSpec(driveDataSourceSpec); const multiSelect = CardService.newSelectionInput() .setType(CardService.SelectionInputType.MULTI_SELECT) .setFieldName('files') .setTitle('Drive Files') .setMultiSelectMaxSelectedItems(5) .setMultiSelectMinQueryLength(1) .setPlatformDataSource(platformDataSource);
https://www.googleapis.com/auth/drive.file)를 추가해야 합니다.매개변수
| 이름 | 유형 | 설명 |
|---|---|---|
drive | Drive | 설정할 드라이브 데이터 소스 사양입니다. |
리턴
Platform - 연결을 위한 이 객체
set Host App Data Source(hostAppDataSource)
다중 선택 메뉴에서 스페이스를 채우는 데 사용됩니다.
const chatSpaceDataSource = CardService.newChatSpaceDataSource().setDefaultToCurrentSpace(true); const chatClientDataSource = CardService.newChatClientDataSource().setSpaceDataSource( chatSpaceDataSource); const hostAppDataSource = CardService.newHostAppDataSource().setChatDataSource(chatClientDataSource); const platformDataSource = CardService.newPlatformDataSource().setHostAppDataSource(hostAppDataSource); const multiSelect = CardService.newSelectionInput() .setType(CardService.SelectionInputType.MULTI_SELECT) .setFieldName('contacts') .setTitle('Selected contacts') .setMultiSelectMaxSelectedItems(5) .setMultiSelectMinQueryLength(1) .setPlatformDataSource(platformDataSource);
매개변수
| 이름 | 유형 | 설명 |
|---|---|---|
host | Host | 설정할 데이터 소스입니다. |
리턴
Platform - 연결을 위한 이 객체