Class DeveloperMetadataLocation

  • The DeveloperMetadataLocation class provides access to information about the location of developer metadata within a spreadsheet.

  • You can retrieve the location type of the metadata using thegetLocationType() method.

  • Methods likegetColumn(),getRow(),getSheet(), andgetSpreadsheet() return the specific location (Range, Sheet, or Spreadsheet) based on the metadata's location type, ornull if it doesn't match.

  • Accessing developer metadata location information typically requires authorization with spreadsheet-related scopes.

DeveloperMetadataLocation

Access developer metadata location information.

Methods

MethodReturn typeBrief description
getColumn()Range|nullReturns theRange for the column location of this metadata, ornull if thelocation type is notDeveloperMetadataLocationType.COLUMN.
getLocationType()DeveloperMetadataLocationTypeGets the type of location.
getRow()Range|nullReturns theRange for the row location of this metadata, ornull if thelocation type is notDeveloperMetadataLocationType.ROW.
getSheet()Sheet|nullReturns theSheet location of this metadata, ornull if the location type isnotDeveloperMetadataLocationType.SHEET.
getSpreadsheet()Spreadsheet|nullReturns theSpreadsheet location of this metadata, ornull if the locationtype is notDeveloperMetadataLocationType.SPREADSHEET.

Detailed documentation

getColumn()

Returns theRange for the column location of this metadata, ornull if thelocation type is notDeveloperMetadataLocationType.COLUMN.

Return

Range|null — TheRange for the column location of this metadata, ornull if the location type is notDeveloperMetadataLocationType.COLUMN.

Authorization

Scripts that use this method require authorization with one or more of the followingscopes:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getLocationType()

Gets the type of location.

Return

DeveloperMetadataLocationType — The location type.

Authorization

Scripts that use this method require authorization with one or more of the followingscopes:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getRow()

Returns theRange for the row location of this metadata, ornull if thelocation type is notDeveloperMetadataLocationType.ROW.

Return

Range|null — TheRange for the row location of this metadata, ornull if the location type is notDeveloperMetadataLocationType.ROW.

Authorization

Scripts that use this method require authorization with one or more of the followingscopes:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getSheet()

Returns theSheet location of this metadata, ornull if the location type isnotDeveloperMetadataLocationType.SHEET.

Return

Sheet|null — TheSheet location of this metadata, ornull if the location type is notDeveloperMetadataLocationType.SHEET.

Authorization

Scripts that use this method require authorization with one or more of the followingscopes:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getSpreadsheet()

Returns theSpreadsheet location of this metadata, ornull if the locationtype is notDeveloperMetadataLocationType.SPREADSHEET.

Return

Spreadsheet|null — TheSpreadsheet location of this metadata, ornull if the location type is notDeveloperMetadataLocationType.SPREADSHEET.

Authorization

Scripts that use this method require authorization with one or more of the followingscopes:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-11 UTC.