Stay organized with collections Save and categorize content based on your preferences.
LookerDataSourceSpecA DataSourceSpec
which is used to access specifically the existing Looker data source specifications. To create a new data source specification, use SpreadsheetApp.newDataSourceSpec()
.
This example shows how you can get the Looker data source spec from a sheet which has just one Looker connection.
// TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); const lookerDataSourceSpec = ss.getDataSources()[0].getSpec().asLooker();Detailed documentation
copy()
Creates a DataSourceSpecBuilder
based on this data source's settings.
// TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); const spec = ss.getDataSources()[0].getSpec(); const newSpec = spec.copy();Return
DataSourceSpecBuilder
— The builder.
getExploreName()
Gets the name of the Looker explore in the model.
// TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); const lookerDataSourceSpec = ss.getDataSources()[0].getSpec().asLooker(); const exploreName = lookerDataSourceSpec.getExploreName(); Logger.log(exploreName);Return
String
— The name of the Looker explore.
getInstanceUrl()
Gets the URL of the Looker instance.
// TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); const lookerDataSourceSpec = ss.getDataSources()[0].getSpec().asLooker(); const instanceUrl = lookerDataSourceSpec.getInstanceUrl(); Logger.log(instanceUrl);Return
String
— The URL of the Looker instance.
getModelName()
Gets the name of the Looker model in the instance.
// TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); const lookerDataSourceSpec = ss.getDataSources()[0].getSpec().asLooker(); const modelName = lookerDataSourceSpec.getModelName(); Logger.log(modelName);Return
String
— The name of the Looker model.
getParameters()
Gets the parameters of the data source.
// TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); const spec = ss.getDataSources()[0].getSpec(); const parameters = spec.getParameters();
This method is only available for BigQuery data sources.
ReturnDataSourceParameter[]
— The parameter list.
getType()
Gets the type of the data source.
// TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); const spec = ss.getDataSources()[0].getSpec(); const type = spec.getType();Return
DataSourceType
— The data source type.
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 2024-12-03 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-12-03 UTC."],[[["`LookerDataSourceSpec` enables access to existing Looker data source specifications within Google Sheets."],["To create new data source specifications, use `SpreadsheetApp.newDataSourceSpec()`."],["You can retrieve details such as explore name, instance URL, and model name from a `LookerDataSourceSpec` object."],["Several methods, including `copy()`, `getExploreName()`, `getInstanceUrl()`, `getModelName()`, `getParameters()`, and `getType()`, are available for interacting with Looker data source specifications."],["The `getParameters()` method is specific to BigQuery data sources and retrieves their parameters."]]],["The `LookerDataSourceSpec` accesses existing Looker data sources. Key actions include retrieving data source details via methods: `getExploreName()` gets the Looker explore name, `getInstanceUrl()` gets the Looker instance URL, and `getModelName()` gets the Looker model name. `getParameters()` retrieves data source parameters (available only for BigQuery), and `getType()` gets the data source type. The `copy()` method creates a `DataSourceSpecBuilder` based on current settings. You can retrieve the looker data source by using `getDataSources()[0].getSpec().asLooker()`.\n"]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4