Class PlatformDataSource

PlatformVeriKaynak

Çoklu seçim menüsü kullanan bir SelectionInput widget'ı için Google Workspace'ten bir veri kaynağı. Çoklu seçim menüsündeki öğeleri doldurmak için kullanılır.

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);

Yalnızca Google Chat uygulamalarında kullanılabilir. Google Workspace eklentileri için kullanılamaz.

Yöntemler

YöntemDönüş türüKısa açıklama
setCommonDataSource(commonDataSource)PlatformDataSourceGoogle Workspace'ten veri kaynağını ayarlar.
setDriveDataSourceSpec(driveDataSourceSpec)PlatformDataSourceGoogle Workspace'ten sürücü veri kaynağı spesifikasyonunu ayarlar.
setHostAppDataSource(hostAppDataSource)PlatformDataSourceÇoklu seçim menüsündeki alanları doldurmak için kullanılır.

Ayrıntılı belgeler

setCommonDataSource(commonDataSource)

Google Workspace'ten veri kaynağını ayarlar.

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);
Yalnızca Google Chat uygulamalarında kullanılabilir. Google Workspace eklentileri için kullanılamaz.

Parametreler

AdTürAçıklama
commonDataSourceCommonDataSourceAyarlanacak veri kaynağı.

Return

PlatformDataSource: Zincirleme için kullanılan bu nesne.


setDriveDataSourceSpec(driveDataSourceSpec)

Google Workspace'ten sürücü veri kaynağı spesifikasyonunu ayarlar.

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);
Google Chat uygulamalarında kullanılabilir. Google Workspace eklentileri için manifest dosyasına Dosya başına erişim kapsamı(https://www.googleapis.com/auth/drive.file) eklenmesi gerekir.

Parametreler

AdTürAçıklama
driveDataSourceSpecDriveDataSourceSpecAyarlanacak sürücü veri kaynağı spesifikasyonu.

Return

PlatformDataSource: Zincirleme için kullanılan bu nesne.


setHostAppDataSource(hostAppDataSource)

Çoklu seçim menüsündeki alanları doldurmak için kullanılır.

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);
Yalnızca Google Chat uygulamalarında kullanılabilir. Google Workspace eklentileri için kullanılamaz.

Parametreler

AdTürAçıklama
hostAppDataSourceHostAppDataSourceAyarlanacak veri kaynağı.

Return

PlatformDataSource: Zincirleme için kullanılan bu nesne.