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)PlatformDataSourceتحدِّد هذه السياسة مصدر البيانات من Google 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: هذا الكائن، للتسلسل.