Class DynamicResourceDefinition

DynamicResourceDefinition

A DynamicResourceDefinition is a building block for a ResourceFieldsDefinitionRetrievedAction, it can contain one or more numbers of ResourceField to dynamically define the number of output variables provided by a step in Google Workspace Studio.

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

Sample usage:

let dynamicResourceDefinition = AddOnsResponseService.newDynamicResourceDefinition()
   .setResourceId("resource_definition_1") // The resource ID must match the one defined in the manifest.
   .addResourceField(
     AddOnsResponseService.newResourceField()
       .setSelector("question_1")
       .setDisplayText("Question 1")
   );

Methods

MethodReturn typeBrief description
addResourceField(resourceField)DynamicResourceDefinitionAdds a resource field to the dynamic resource definition.
setResourceId(resourceId)DynamicResourceDefinitionSets the ID for the dynamic resource definition, this ID corresponds to the workflowResourceDefinitionId in the manifest.

Detailed documentation

addResourceField(resourceField)

Adds a resource field to the dynamic resource definition.

Parameters

NameTypeDescription
resourceFieldResourceFieldThe resource field to add.

Return

DynamicResourceDefinition — This object, for chaining.


setResourceId(resourceId)

Sets the ID for the dynamic resource definition, this ID corresponds to the workflowResourceDefinitionId in the manifest.

Parameters

NameTypeDescription
resourceIdStringThe unique identifier for the dynamic resource definition.

Return

DynamicResourceDefinition — This object, for chaining.