A DataType is used to set the type of a variable. The type can be one of the basic data type or a Workspace Studio-specific resource type.
Only available for Google Workspace add-ons that extend Google Workspace Studio.
Sample usage:
const dataType = AddOnsResponseService.newDataType() .setBasicDataType( AddOnsResponseService.BasicDataType.STRING ) .setValueMetadata( AddOnsResponseService.newValueMetadata() .addEnumValue("sample_enum_value") ); let resourceField = AddOnsResponseService.newResourceField() .setSelector("question_1") .setDisplayText("Question 1") .setDataType(dataType); }
Methods
| Method | Return type | Brief description |
|---|---|---|
set | Data | Sets the data type to one of the supported Basics. |
set | Data | Sets the data type to a custom defined Resource. |
set | Data | Sets the Value, which contains type-related information related to the
variable. |
Detailed documentation
setBasicDataType(basicDataType)
Sets the data type to one of the supported Basics.
Parameters
| Name | Type | Description |
|---|---|---|
basic | Basic | The basic data type that the variable belongs to. |
Return
Data — This data type object, for chaining.
setResourceType(resourceType)
Sets the data type to a custom defined Resource.
Parameters
| Name | Type | Description |
|---|---|---|
resource | Resource | The application specific(custom) resource type of the variable. |
Return
Data — This data type object, for chaining.
setValueMetadata(valueMetadata)
Sets the Value, which contains type-related information related to the
variable.
Parameters
| Name | Type | Description |
|---|---|---|
value | Value | The value metadata information about the potential values of the variable. |
Return
Data — This data type object, for chaining.