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

Method Return type Brief description
Dynamic Resource Definition Adds a resource field to the dynamic resource definition.
Dynamic Resource Definition Sets the ID for the dynamic resource definition, this ID corresponds to the workflow Resource Definition Id in the manifest.

Detailed documentation

addResourceField(resourceField)

Adds a resource field to the dynamic resource definition.

Parameters

Name Type Description
resource Field
Resource Field The 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

Name Type Description
resource Id
String The unique identifier for the dynamic resource definition.

Return

DynamicResourceDefinition — This object, for chaining.

Create a Mobile Website
View Site in Mobile | Classic
Share by: