Class GetDataResponse
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
GetDataResponse
Builder का इस्तेमाल करके, अपने स्क्रिप्ट प्रोजेक्ट के लिए getData()
रिस्पॉन्स बनाएं.
function getFields() {
//...
}
function getData() {
const cc = DataStudioApp.createCommunityConnector();
return cc.newGetDataResponse()
.setFields(getFields())
.addRow(['3', 'Foobar.com'])
.addRow(['4', 'Foobaz.com'])
.addRows([
['5', 'Fizzbuz.com'],
['6', 'Fizzbaz.com'],
])
.build();
}
ज़्यादा जानकारी वाला दस्तावेज़
addAllRows(rows)
इस GetDataResponse
में डेटा की कई पंक्तियां जोड़ता है.
पैरामीटर
नाम | टाइप | ब्यौरा |
rows | String[][] | सेट की जाने वाली डेटा लाइनें. |
वापसी का टिकट
GetDataResponse
— यह बिल्डर, चेन करने के लिए है.
addRow(row)
इस GetDataResponse
में डेटा की एक लाइन जोड़ता है.
पैरामीटर
नाम | टाइप | ब्यौरा |
row | String[] | सेट की जाने वाली डेटा लाइन. |
वापसी का टिकट
GetDataResponse
— यह बिल्डर, चेन करने के लिए है.
build()
इस ऑब्जेक्ट की पुष्टि करता है और उसे Data Studio के ज़रूरी फ़ॉर्मैट में दिखाता है.
वापसी का टिकट
Object
— पुष्टि किया गया GetDataResponse
ऑब्जेक्ट.
setFields(fields)
बिल्डर का Fields
सेट करता है.
पैरामीटर
नाम | टाइप | ब्यौरा |
fields | Fields | सेट किए जाने वाले फ़ील्ड. |
वापसी का टिकट
GetDataResponse
— यह बिल्डर, चेन करने के लिए है.
setFiltersApplied(filtersApplied)
इस बिल्डर के लिए, लागू किए गए फ़िल्टर की स्थिति सेट करता है. अगर सभी फ़िल्टर लागू हो गए हैं, तो true
पर सेट करें. अगर ऐसा नहीं है, तो false
पर सेट करें.
पैरामीटर
नाम | टाइप | ब्यौरा |
filtersApplied | Boolean | - लागू किए गए फ़िल्टर की स्थिति सेट करें. |
वापसी का टिकट
GetDataResponse
— यह बिल्डर, चेन करने के लिए है.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया."],[[["\u003cp\u003e\u003ccode\u003eGetDataResponse\u003c/code\u003e helps structure the data your script returns to Data Studio for visualization.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods like \u003ccode\u003eaddRow\u003c/code\u003e, \u003ccode\u003eaddAllRows\u003c/code\u003e, and \u003ccode\u003esetFields\u003c/code\u003e to define the data structure and content.\u003c/p\u003e\n"],["\u003cp\u003eUse \u003ccode\u003ebuild()\u003c/code\u003e to finalize and send the data to Data Studio in the correct format.\u003c/p\u003e\n"],["\u003cp\u003eYou can signal if Data Studio filters were applied using \u003ccode\u003esetFiltersApplied\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Class GetDataResponse\n\nGetDataResponse\n\nBuilder to create a `get``Data()` response for your script project.\n\n```javascript\nfunction getFields() {\n //...\n}\n\nfunction getData() {\n const cc = DataStudioApp.createCommunityConnector();\n\n return cc.newGetDataResponse()\n .setFields(getFields())\n .addRow(['3', 'Foobar.com'])\n .addRow(['4', 'Foobaz.com'])\n .addRows([\n ['5', 'Fizzbuz.com'],\n ['6', 'Fizzbaz.com'],\n ])\n .build();\n}\n``` \n\n### Methods\n\n| Method | Return type | Brief description |\n|------------------------------------------------------------------|----------------------|------------------------------------------------------------------------------|\n| [addAllRows(rows)](#addAllRows(String)) | [GetDataResponse](#) | Adds multiple rows of data to this [GetDataResponse](#). |\n| [addRow(row)](#addRow(String)) | [GetDataResponse](#) | Adds a row of data to this [GetDataResponse](#). |\n| [build()](#build()) | `Object` | Validates this object and returns it in the format needed by Data Studio. |\n| [setFields(fields)](#setFields(Fields)) | [GetDataResponse](#) | Sets the [Fields](/apps-script/reference/data-studio/fields) of the builder. |\n| [setFiltersApplied(filtersApplied)](#setFiltersApplied(Boolean)) | [GetDataResponse](#) | Sets the filters applied status for this builder. |\n\nDetailed documentation\n----------------------\n\n### `add``All``Rows(rows)`\n\nAdds multiple rows of data to this [GetDataResponse](#).\n\n#### Parameters\n\n| Name | Type | Description |\n|--------|--------------|--------------------------|\n| `rows` | `String[][]` | The rows of data to set. |\n\n#### Return\n\n\n[GetDataResponse](#) --- This builder, for chaining.\n\n*** ** * ** ***\n\n### `add``Row(row)`\n\nAdds a row of data to this [GetDataResponse](#).\n\n#### Parameters\n\n| Name | Type | Description |\n|-------|------------|-------------------------|\n| `row` | `String[]` | The row of data to set. |\n\n#### Return\n\n\n[GetDataResponse](#) --- This builder, for chaining.\n\n*** ** * ** ***\n\n### `build()`\n\nValidates this object and returns it in the format needed by Data Studio.\n\n#### Return\n\n\n`Object` --- The validated [GetDataResponse](#) object.\n\n*** ** * ** ***\n\n### `set``Fields(fields)`\n\nSets the [Fields](/apps-script/reference/data-studio/fields) of the builder.\n\n#### Parameters\n\n| Name | Type | Description |\n|----------|-----------------------------------------------------|--------------------|\n| `fields` | [Fields](/apps-script/reference/data-studio/fields) | The fields to set. |\n\n#### Return\n\n\n[GetDataResponse](#) --- This builder, for chaining.\n\n*** ** * ** ***\n\n### `set``Filters``Applied(filtersApplied)`\n\nSets the filters applied status for this builder. Set to `true` if all filters were\nsuccessfully applied, `false` otherwise.\n\n#### Parameters\n\n| Name | Type | Description |\n|--------------------|-----------|--------------------------------------|\n| `filters``Applied` | `Boolean` | - The filters applied status to set. |\n\n#### Return\n\n\n[GetDataResponse](#) --- This builder, for chaining."]]