সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
স্কিমা প্রতিক্রিয়া পান
আপনার স্ক্রিপ্ট প্রকল্পের জন্য একটি get Schema() প্রতিক্রিয়া তৈরি করতে নির্মাতা।
functiongetSchema(){constcc=DataStudioApp.createCommunityConnector();constfields=cc.getFields();fields.newDimension().setId('Created').setName('Date Created').setDescription('The date that this was created').setType(cc.FieldType.YEAR_MONTH_DAY);fields.newMetric().setId('Amount').setName('Amount (USD)').setDescription('The cost in US dollars').setType(cc.FieldType.CURRENCY_USD);returncc.newGetSchemaResponse().setFields(fields).build();}
[[["সহজে বোঝা যায়","easyToUnderstand","thumb-up"],["আমার সমস্যার সমাধান হয়েছে","solvedMyProblem","thumb-up"],["অন্যান্য","otherUp","thumb-up"]],[["এতে আমার প্রয়োজনীয় তথ্য নেই","missingTheInformationINeed","thumb-down"],["খুব জটিল / অনেক ধাপ","tooComplicatedTooManySteps","thumb-down"],["পুরনো","outOfDate","thumb-down"],["অনুবাদ সংক্রান্ত সমস্যা","translationIssue","thumb-down"],["নমুনা / কোড সংক্রান্ত সমস্যা","samplesCodeIssue","thumb-down"],["অন্যান্য","otherDown","thumb-down"]],["2025-07-24 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003e\u003ccode\u003egetSchemaResponse\u003c/code\u003e facilitates the creation of a schema for your Data Studio Community Connector, defining the structure of data your connector provides.\u003c/p\u003e\n"],["\u003cp\u003eIt allows you to specify dimensions and metrics, including their data types, descriptions, and IDs, using the \u003ccode\u003efields\u003c/code\u003e object.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ebuild()\u003c/code\u003e method finalizes the schema definition and returns a validated object in the format required by Data Studio.\u003c/p\u003e\n"],["\u003cp\u003eAdditional methods like \u003ccode\u003eprintJson()\u003c/code\u003e and \u003ccode\u003esetFields()\u003c/code\u003e are available for debugging and further schema customization.\u003c/p\u003e\n"]]],["The `getSchema()` function defines data fields for a script project using the `DataStudioApp` service. It creates a dimension field named \"Date Created\" of `YEAR_MONTH_DAY` type and a metric field \"Amount (USD)\" of `CURRENCY_USD` type. The `newGetSchemaResponse()` builder then compiles and validates these fields using `setFields()` before the final format for Data Studio is produced using `build()`. `printJson()` outputs a JSON representation for debugging.\n"],null,["# Class GetSchemaResponse\n\nGetSchemaResponse\n\nBuilder to create a `get``Schema()` response for your script project.\n\n```javascript\nfunction getSchema() {\n const cc = DataStudioApp.createCommunityConnector();\n const fields = cc.getFields();\n\n fields.newDimension()\n .setId('Created')\n .setName('Date Created')\n .setDescription('The date that this was created')\n .setType(cc.FieldType.YEAR_MONTH_DAY);\n\n fields.newMetric()\n .setId('Amount')\n .setName('Amount (USD)')\n .setDescription('The cost in US dollars')\n .setType(cc.FieldType.CURRENCY_USD);\n\n return cc.newGetSchemaResponse().setFields(fields).build();\n}\n``` \n\n### Methods\n\n| Method | Return type | Brief description |\n|-----------------------------------------|------------------------|------------------------------------------------------------------------------|\n| [build()](#build()) | `Object` | Validates this object and returns it in the format needed by Data Studio. |\n| [printJson()](#printJson()) | `String` | Prints the JSON representation of this object. |\n| [setFields(fields)](#setFields(Fields)) | [GetSchemaResponse](#) | Sets the [Fields](/apps-script/reference/data-studio/fields) of the builder. |\n\nDetailed documentation\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 [GetSchemaResponse](#) object.\n\n*** ** * ** ***\n\n### `print``Json()`\n\nPrints the JSON representation of this object. This is for debugging only.\n\n#### Return\n\n\n`String`\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[GetSchemaResponse](#) --- This builder, for chaining."]]