Class PlatformDataSource

PlatformDataSource

Đối với tiện ích SelectionInput sử dụng trình đơn nhiều lựa chọn, một nguồn dữ liệu từ Google Workspace. Dùng để điền các mục trong trình đơn chọn nhiều mục.

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

Chỉ dành cho các ứng dụng Google Chat. Không sử dụng được với tiện ích bổ sung của Google Workspace.

Phương thức

Phương thứcKiểu dữ liệu trả vềMô tả ngắn
setCommonDataSource(commonDataSource)PlatformDataSourceThiết lập nguồn dữ liệu trên Google Workspace.
setHostAppDataSource(hostAppDataSource)PlatformDataSourceDùng để điền sẵn các không gian trong trình đơn chọn nhiều mục.

Tài liệu chi tiết

setCommonDataSource(commonDataSource)

Thiết lập nguồn dữ liệu trên 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);
Chỉ có trong các ứng dụng Google Chat. Không sử dụng được với tiện ích bổ sung của Google Workspace.

Tham số

TênLoạiNội dung mô tả
commonDataSourceCommonDataSourceNguồn dữ liệu cần được đặt.

Cầu thủ trả bóng

PlatformDataSource – Đối tượng này để tạo chuỗi.


setHostAppDataSource(hostAppDataSource)

Dùng để điền sẵn các không gian trong trình đơn chọn nhiều mục.

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);
Chỉ có trong các ứng dụng Google Chat. Không sử dụng được với tiện ích bổ sung của Google Workspace.

Tham số

TênLoạiNội dung mô tả
hostAppDataSourceHostAppDataSourceNguồn dữ liệu cần được đặt.

Cầu thủ trả bóng

PlatformDataSource – Đối tượng này để tạo chuỗi.