Class GetDataResponse

  • GetDataResponse is a builder used to create a getData() response for your script project.

  • You can add single rows of data using addRow() or multiple rows using addAllRows().

  • setFields() is used to set the fields of the builder.

  • The build() method validates the object and returns it in the format needed by Data Studio.

GetDataResponse

Builder to create a getData() response for your script project.

functiongetFields(){
//...
}
functiongetData(){
constcc=DataStudioApp.createCommunityConnector();
returncc.newGetDataResponse()
.setFields(getFields())
.addRow(['3','Foobar.com'])
.addRow(['4','Foobaz.com'])
.addRows([
['5','Fizzbuz.com'],
['6','Fizzbaz.com'],
])
.build();
}

Methods

MethodReturn typeBrief description
addAllRows(rows) GetDataResponse Adds multiple rows of data to this GetDataResponse .
addRow(row) GetDataResponse Adds a row of data to this GetDataResponse .
build() ObjectValidates this object and returns it in the format needed by Data Studio.
setFields(fields) GetDataResponse Sets the Fields of the builder.
setFiltersApplied(filtersApplied) GetDataResponse Sets the filters applied status for this builder.

Detailed documentation

addAllRows(rows)

Adds multiple rows of data to this GetDataResponse .

Parameters

NameTypeDescription
rowsString[][]The rows of data to set.

Return

GetDataResponse — This builder, for chaining.


addRow(row)

Adds a row of data to this GetDataResponse .

Parameters

NameTypeDescription
rowString[]The row of data to set.

Return

GetDataResponse — This builder, for chaining.


build()

Validates this object and returns it in the format needed by Data Studio.

Return

Object — The validated GetDataResponse object.


setFields(fields)

Sets the Fields of the builder.

Parameters

NameTypeDescription
fieldsFields The fields to set.

Return

GetDataResponse — This builder, for chaining.


setFiltersApplied(filtersApplied)

Sets the filters applied status for this builder. Set to true if all filters were successfully applied, false otherwise.

Parameters

NameTypeDescription
filtersAppliedBoolean- The filters applied status to set.

Return

GetDataResponse — This builder, 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 2026年04月13日 UTC.