Class ResourceData

ResourceData

Represents a application specific resource data, a resource data contains a collection of key-value pairs of variable names and VariableData .

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

Sample usage:

letcustomResourceData=AddOnsResponseService.newResourceData()
.setVariableDataMap(
{
"field_1":fieldData_1,
"field_2":fieldData_2
}
);
letoutputVariableData=AddOnsResponseService.newVariableData()
.addResourceData(customResourceData);
letworkflowAction=AddOnsResponseService.newReturnOutputVariablesAction()
.setVariableDataMap({"resource_data":outputVariableData});

Methods

MethodReturn typeBrief description
addVariableData(key, value) ResourceData Adds a VariableData keyed by its variable name, a value is overwritten if the key already exists.
setVariableDataMap(fields) ResourceData Sets the map of the variable data keyed by variable names.

Detailed documentation

addVariableData(key, value)

Adds a VariableData keyed by its variable name, a value is overwritten if the key already exists.

Parameters

NameTypeDescription
keyStringThe variable name to retrieve the corresponding variable data.
valueVariableData The VariableData to be added.

Return

ResourceData — This resource data object, for chaining.


setVariableDataMap(fields)

Sets the map of the variable data keyed by variable names.

Parameters

NameTypeDescription
fieldsObjectA collection of key-value pairs of string and variable data.

Return

ResourceData — This resource data 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.