সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
ডেটা সোর্স স্পেসিক
একটি বিদ্যমান ডেটা উৎস বিশেষের সাধারণ সেটিংস অ্যাক্সেস করুন। নির্দিষ্ট ধরনের ডেটা সোর্স স্পেক অ্যাক্সেস করতে, as...() পদ্ধতি ব্যবহার করুন। একটি নতুন ডেটা সোর্স স্পেক তৈরি করতে, Spreadsheet App.newDataSourceSpec() ।
শুধুমাত্র একটি ডাটাবেসের সাথে সংযুক্ত ডেটা সহ এই ক্লাসটি ব্যবহার করুন।
এই উদাহরণে দেখানো হয়েছে কিভাবে BigQuery ডেটা সোর্স স্পেক থেকে তথ্য পেতে হয়।
এই উদাহরণটি দেখায় কিভাবে একটি লুকার ডেটা সোর্স স্পেক থেকে তথ্য পেতে হয়। as Looker() ব্যবহার করা একটি Looker Data Source Spec অবজেক্ট প্রদান করে।
// TODO(developer): Replace the URL with your own.constss=SpreadsheetApp.openByUrl('https://docs.google.com/spreadsheets/d/abc123456/edit',);constspec=ss.getDataSources()[0].getSpec().asLooker();if(spec.getType()===SpreadsheetApp.DataSourceType.LOOKER){constlookerSpec=spec.asLooker();Logger.log('Looker instance URL: %s\n',lookerSpec.getInstanceUrl());}
// TODO(developer): Replace the URL with your own.constss=SpreadsheetApp.openByUrl('https://docs.google.com/spreadsheets/d/abc123456/edit',);constspec=ss.getDataSources()[0].getSpec().asLooker();
// TODO(developer): Replace the URL with your own.constss=SpreadsheetApp.openByUrl('https://docs.google.com/spreadsheets/d/abc123456/edit',);constspec=ss.getDataSources()[0].getSpec();constnewSpec=spec.copy();
// TODO(developer): Replace the URL with your own.constss=SpreadsheetApp.openByUrl('https://docs.google.com/spreadsheets/d/abc123456/edit',);constspec=ss.getDataSources()[0].getSpec();constparameters=spec.getParameters();
এই পদ্ধতি শুধুমাত্র BigQuery ডেটা উৎসের জন্য উপলব্ধ।
// TODO(developer): Replace the URL with your own.constss=SpreadsheetApp.openByUrl('https://docs.google.com/spreadsheets/d/abc123456/edit',);constspec=ss.getDataSources()[0].getSpec();consttype=spec.getType();
[[["সহজে বোঝা যায়","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\u003eDataSourceSpec\u003c/code\u003e provides access to the general settings of an existing database-connected data source.\u003c/p\u003e\n"],["\u003cp\u003eTo access type-specific settings, utilize the \u003ccode\u003eas...()\u003c/code\u003e methods (e.g., \u003ccode\u003easBigQuery()\u003c/code\u003e, \u003ccode\u003easLooker()\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eYou can create a new data source specification using \u003ccode\u003eSpreadsheetApp.newDataSourceSpec()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ecopy()\u003c/code\u003e method facilitates creating a \u003ccode\u003eDataSourceSpecBuilder\u003c/code\u003e to modify existing settings.\u003c/p\u003e\n"],["\u003cp\u003eMethods like \u003ccode\u003egetParameters()\u003c/code\u003e and \u003ccode\u003egetType()\u003c/code\u003e allow retrieval of data source parameters and type respectively.\u003c/p\u003e\n"]]],["`DataSourceSpec` accesses settings of existing data sources connected to databases. Use `as...()` to access specific types, like `asBigQuery()` or `asLooker()`. Key actions include: retrieving data source type with `getType()`, fetching parameters via `getParameters()`, and creating a modifiable copy using `copy()`. For example, retrieve BigQuery project ID and raw query string, or get a Looker instance URL. This class can not be used with new data source, use `SpreadsheetApp.newDataSourceSpec()` instead.\n"],null,["DataSourceSpec\n\nAccess the general settings of an existing data source spec. To access data source spec for\ncertain type, use `as...()` method. To create a new data source spec, use [SpreadsheetApp.newDataSourceSpec()](/apps-script/reference/spreadsheet/spreadsheet-app#newDataSourceSpec()).\n\n\n**Only use this class with data that's connected to a database.**\n\n\nThis example shows how to get information from a BigQuery data source spec.\n\n```javascript\nconst dataSourceTable = SpreadsheetApp.getActive()\n .getSheetByName('Data Sheet 1')\n .getDataSourceTables()[0];\nconst spec = dataSourceTable.getDataSource().getSpec();\nif (spec.getType() === SpreadsheetApp.DataSourceType.BIGQUERY) {\n const bqSpec = spec.asBigQuery();\n Logger.log('Project ID: %s\\n', bqSpec.getProjectId());\n Logger.log('Raw query string: %s\\n', bqSpec.getRawQuery());\n}\n```\n\nThis example shows how to get information from a Looker data source spec. Using `as``Looker()` returns a [LookerDataSourceSpec](/apps-script/reference/spreadsheet/looker-data-source-spec) object.\n\n```javascript\n// TODO(developer): Replace the URL with your own.\nconst ss = SpreadsheetApp.openByUrl(\n 'https://docs.google.com/spreadsheets/d/abc123456/edit',\n);\nconst spec = ss.getDataSources()[0].getSpec().asLooker();\n\nif (spec.getType() === SpreadsheetApp.DataSourceType.LOOKER) {\n const lookerSpec = spec.asLooker();\n Logger.log('Looker instance URL: %s\\n', lookerSpec.getInstanceUrl());\n}\n``` \n\nMethods\n\n| Method | Return type | Brief description |\n|-------------------------------------|-----------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|\n| [asBigQuery()](#asBigQuery()) | [BigQueryDataSourceSpec](/apps-script/reference/spreadsheet/big-query-data-source-spec) | Gets the spec for BigQuery data source. |\n| [asLooker()](#asLooker()) | [LookerDataSourceSpec](/apps-script/reference/spreadsheet/looker-data-source-spec) | Gets the spec for Looker data source. |\n| [copy()](#copy()) | [DataSourceSpecBuilder](/apps-script/reference/spreadsheet/data-source-spec-builder) | Creates a [DataSourceSpecBuilder](/apps-script/reference/spreadsheet/data-source-spec-builder) based on this data source's settings. |\n| [getParameters()](#getParameters()) | [DataSourceParameter[]](/apps-script/reference/spreadsheet/data-source-parameter) | Gets the parameters of the data source. |\n| [getType()](#getType()) | [DataSourceType](/apps-script/reference/spreadsheet/data-source-type) | Gets the type of the data source. |\n\nDetailed documentation \n\n`as``Big``Query()` \nGets the spec for BigQuery data source.\n\nReturn\n\n\n[BigQueryDataSourceSpec](/apps-script/reference/spreadsheet/big-query-data-source-spec) --- The BigQuery data source spec.\n\n*** ** * ** ***\n\n`as``Looker()` \nGets the spec for Looker data source.\n\n```javascript\n// TODO(developer): Replace the URL with your own.\nconst ss = SpreadsheetApp.openByUrl(\n 'https://docs.google.com/spreadsheets/d/abc123456/edit',\n);\nconst spec = ss.getDataSources()[0].getSpec().asLooker();\n```\n\nReturn\n\n\n[LookerDataSourceSpec](/apps-script/reference/spreadsheet/looker-data-source-spec) --- The Looker data source spec.\n\n*** ** * ** ***\n\n`copy()` \nCreates a [DataSourceSpecBuilder](/apps-script/reference/spreadsheet/data-source-spec-builder) based on this data source's settings.\n\n```javascript\n// TODO(developer): Replace the URL with your own.\nconst ss = SpreadsheetApp.openByUrl(\n 'https://docs.google.com/spreadsheets/d/abc123456/edit',\n);\nconst spec = ss.getDataSources()[0].getSpec();\n\nconst newSpec = spec.copy();\n```\n\nReturn\n\n\n[DataSourceSpecBuilder](/apps-script/reference/spreadsheet/data-source-spec-builder) --- The builder.\n\n*** ** * ** ***\n\n`get``Parameters()` \nGets the parameters of the data source.\n\n```javascript\n// TODO(developer): Replace the URL with your own.\nconst ss = SpreadsheetApp.openByUrl(\n 'https://docs.google.com/spreadsheets/d/abc123456/edit',\n);\nconst spec = ss.getDataSources()[0].getSpec();\nconst parameters = spec.getParameters();\n```\n\nThis method is only available for BigQuery data sources.\n\nReturn\n\n\n[DataSourceParameter[]](/apps-script/reference/spreadsheet/data-source-parameter) --- The parameter list.\n\n*** ** * ** ***\n\n`get``Type()` \nGets the type of the data source.\n\n```javascript\n// TODO(developer): Replace the URL with your own.\nconst ss = SpreadsheetApp.openByUrl(\n 'https://docs.google.com/spreadsheets/d/abc123456/edit',\n);\nconst spec = ss.getDataSources()[0].getSpec();\nconst type = spec.getType();\n```\n\nReturn\n\n\n[DataSourceType](/apps-script/reference/spreadsheet/data-source-type) --- The data source type."]]