Class ResourceField

ResourceField

A ResourceField is a basic building block of a DynamicResourceDefinition , each resource field corresponds to a output variable of the current step. A single DynamicResourceDefinition can contain multiple resource fields.

Only available for Google Workspace add-ons that extend Google Workspace Studio.

Sample usage:

functiononDynamicDefinitionFunction(e){
// ...
letresourceField=AddOnsResponseService.newResourceField()
.setSelector("question_1")
.setDisplayText("Question 1")
.setDataType(AddOnsResponseService.newDataType()
.setBasicDataType(AddOnsResponseService.BasicDataType.STRING)
);
letresourceDefinitions=AddOnsResponseService.newDynamicResourceDefinition()
.setResourceId("resource_definition_1")
.addResourceField(resourceField);
// ...
}
functiononDynamicProviderFunction(e){
// ...
letworkflowAction=AddOnsResponseService.newResourceRetrievedAction()
.setResourceData(
AddOnsResponseService.newResourceData()
.addVariableData("question_1",AddOnsResponseService.newVariableData().addStringValue("Answer 1"))
);
// ...
}

Methods

MethodReturn typeBrief description
setDataType(dataType) ResourceField Sets the data type of the field, allows other steps to filter the variables by type at selection.
setDisplayText(displayText) ResourceField Sets the description of the field that is displayed to the end user during variable selection in subsequent steps.
setSelector(selector) ResourceField Sets a key for the provider function to provide the value to during the step's execution.

Detailed documentation

setDataType(dataType)

Sets the data type of the field, allows other steps to filter the variables by type at selection.

Parameters

NameTypeDescription
dataTypeDataType A data type object, which can be a basic data type or a custom resource type.

Return

ResourceField — This resource field object, for chaining.


setDisplayText(displayText)

Sets the description of the field that is displayed to the end user during variable selection in subsequent steps.

Parameters

NameTypeDescription
displayTextStringThe description for end users at variable selection.

Return

ResourceField — This resource field object, for chaining.


setSelector(selector)

Sets a key for the provider function to provide the value to during the step's execution.

Parameters

NameTypeDescription
selectorStringThe field's reference key used to retrieve its associated VariableData with the same key used in ResourceData .

Return

ResourceField — This resource field 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.