Class DataSourceConfig

DataSourceConfig

A configuration object that helps configure the data sources for a widget.

Sample usage:

constdataSourceConfig=CardService.newDataSourceConfig()
.setPlatformDataSource(CardService.newPlatformDataSource()
.setWorkflowDataSource(CardService.WorkflowDataSourceType.USER));

Methods

MethodReturn typeBrief description
setMaxCharactersToDisable(maxCharactersToDisable) DataSourceConfig Sets the maximum number of characters the user can enter before this data provider is disabled.
setMaxResults(maxResults) DataSourceConfig Sets the maximum number of results to return.
setMinCharactersToTrigger(minCharactersToTrigger) DataSourceConfig Sets the minimum number of characters the user must enter before this data provider is triggered to return results.
setPlatformDataSource(platformDataSource) DataSourceConfig Sets the data source to a platform data source.
setRemoteDataSource(action) DataSourceConfig Sets the data source to a remote data provider.

Detailed documentation

setMaxCharactersToDisable(maxCharactersToDisable)

Sets the maximum number of characters the user can enter before this data provider is disabled. Results are not shown if the input exceeds this length.

Parameters

NameTypeDescription
maxCharactersToDisableIntegerThe maximum number of characters required. A value of 0 means no limit, always enabled.

Return

DataSourceConfig — This object, for chaining.


setMaxResults(maxResults)

Sets the maximum number of results to return.

Parameters

NameTypeDescription
maxResultsIntegerThe maximum number of results to return.

Return

DataSourceConfig — This object, for chaining.


setMinCharactersToTrigger(minCharactersToTrigger)

Sets the minimum number of characters the user must enter before this data provider is triggered to return results.

Parameters

NameTypeDescription
minCharactersToTriggerIntegerThe minimum number of characters required.

Return

DataSourceConfig — This object, for chaining.


setPlatformDataSource(platformDataSource)

Sets the data source to a platform data source.

Parameters

NameTypeDescription
platformDataSourcePlatformDataSource A data source that is shared by all Google Workspace applications.

Return

DataSourceConfig — This object, for chaining.


setRemoteDataSource(action)

Sets the data source to a remote data provider.

Parameters

NameTypeDescription
actionAction An action that returns data.

Return

DataSourceConfig — This object, for chaining.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年12月03日 UTC.