Class GetDataResponse Stay organized with collections Save and categorize content based on your preferences.
Page Summary
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 usingaddAllRows().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.
Builder to create aget 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
| Method | Return type | Brief description |
|---|---|---|
add | Get | Adds multiple rows of data to thisGet. |
add | Get | Adds a row of data to thisGet. |
build() | Object | Validates this object and returns it in the format needed by Data Studio. |
set | Get | Sets theFields of the builder. |
set | Get | Sets the filters applied status for this builder. |
Detailed documentation
addAllRows(rows)
Adds multiple rows of data to thisGet.
Parameters
| Name | Type | Description |
|---|---|---|
rows | String[][] | The rows of data to set. |
Return
Get — This builder, for chaining.
addRow(row)
Adds a row of data to thisGet.
Parameters
| Name | Type | Description |
|---|---|---|
row | String[] | The row of data to set. |
Return
Get — This builder, for chaining.
build()
Validates this object and returns it in the format needed by Data Studio.
Return
Object — The validatedGet object.
setFields(fields)
Sets theFields of the builder.
Parameters
| Name | Type | Description |
|---|---|---|
fields | Fields | The fields to set. |
Return
Get — This builder, for chaining.
setFiltersApplied(filtersApplied)
Sets the filters applied status for this builder. Set totrue if all filters weresuccessfully applied,false otherwise.
Parameters
| Name | Type | Description |
|---|---|---|
filters | Boolean | - The filters applied status to set. |
Return
Get — This builder, for chaining.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-11 UTC.