Class 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.

Methods

שיטהסוג הערך שמוחזרתיאור קצר
setCommonDataSource(commonDataSource)PlatformDataSourceהגדרת מקור הנתונים מ-Google Workspace.
setDriveDataSourceSpec(driveDataSourceSpec)PlatformDataSourceהגדרת מפרט מקור הנתונים של Drive מ-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 – האובייקט הזה, לשרשור.


setDriveDataSourceSpec(driveDataSourceSpec)

הגדרת מפרט מקור הנתונים של Drive מ-Google Workspace.

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. לגבי תוספים ל-Google Workspace, צריך להוסיף היקף הרשאות לגישה לכל קובץ(https://www.googleapis.com/auth/drive.file) למניפסט.

פרמטרים

שםסוגתיאור
driveDataSourceSpecDriveDataSourceSpecמפרט מקור הנתונים של Drive שצריך להגדיר.

חזרה

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