Class PlatformDataSource

PlatformDataSource

다중 선택 메뉴를 사용하는 SelectionInput 위젯의 경우 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 부가기능에는 사용할 수 없습니다.

방법

메서드반환 유형간략한 설명
setCommonDataSource(commonDataSource)PlatformDataSourceGoogle Workspace에서 데이터 소스를 설정합니다.
setHostAppDataSource(hostAppDataSource)PlatformDataSource다중 선택 메뉴에서 공백을 채우는 데 사용됩니다.

자세한 문서

setCommonDataSource(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);
Google Chat 앱에서만 사용할 수 있습니다. Google Workspace 부가기능에는 사용할 수 없습니다.

매개변수

이름유형설명
commonDataSourceCommonDataSource설정할 데이터 소스입니다.

리턴

PlatformDataSource: 체이닝용 객체입니다.


setHostAppDataSource(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);
Google Chat 앱에서만 사용할 수 있습니다. Google Workspace 부가기능에는 사용할 수 없습니다.

매개변수

이름유형설명
hostAppDataSourceHostAppDataSource설정할 데이터 소스입니다.

리턴

PlatformDataSource: 체이닝용 객체입니다.