Class LookerDataSourceSpec

Looker Data Source Spec

A Data Source Spec which is used to access specifically the existing Looker data source specifications. To create a new data source specification, use Spreadsheet App.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 
 (); 

Methods

Method Return type Brief description
Data Source Spec Builder Creates a Data Source Spec Builder based on this data source's settings.
String Gets the name of the Looker explore in the model.
String Gets the URL of the Looker instance.
String Gets the name of the Looker model in the instance.
Data Source Parameter[] Gets the parameters of the data source.
Data Source Type Gets the type of the data source.

Detailed documentation

copy()

Creates a Data Source Spec Builder 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

Data Source Spec Builder — The builder.


get Explore Name()

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.


get Instance Url()

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.


get Model Name()

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.


get Parameters()

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.

Return

Data Source Parameter[] — The parameter list.


get Type()

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

Data Source Type — The data source type.

Create a Mobile Website
View Site in Mobile | Classic
Share by: