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 – האובייקט הזה, לשרשור.