Class DeveloperMetadata

DeveloperMetadata

Access and modify developer metadata. To create new developer metadata use Range.addDeveloperMetadata(key), Sheet.addDeveloperMetadata(key), or Spreadsheet.addDeveloperMetadata(key).

Methods

MethodReturn typeBrief description
getId()IntegerReturns the unique ID associated with this developer metadata.
getKey()StringReturns the key associated with this developer metadata.
getLocation()DeveloperMetadataLocationReturns the location of this developer metadata.
getValue()StringReturns the value associated with this developer metadata, or null if this metadata has no value.
getVisibility()DeveloperMetadataVisibilityReturns the visibility of this developer metadata.
moveToColumn(column)DeveloperMetadataMoves this developer metadata to the specified column.
moveToRow(row)DeveloperMetadataMoves this developer metadata to the specified row.
moveToSheet(sheet)DeveloperMetadataMoves this developer metadata to the specified sheet.
moveToSpreadsheet()DeveloperMetadataMoves this developer metadata to the top-level spreadsheet.
remove()voidDeletes this metadata.
setKey(key)DeveloperMetadataSets the key of this developer metadata to the specified value.
setValue(value)DeveloperMetadataSets the value associated with this developer metadata to the specified value.
setVisibility(visibility)DeveloperMetadataSets the visibility of this developer metadata to the specified visibility.

Detailed documentation

getId()

Returns the unique ID associated with this developer metadata.

Return

Integer — The unique ID associated with this developer metadata.

Authorization

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

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

getKey()

Returns the key associated with this developer metadata.

Return

String — The key associated with this developer metadata.

Authorization

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

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

getLocation()

Returns the location of this developer metadata.

Return

DeveloperMetadataLocation — The location of this developer metadata.

Authorization

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

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

getValue()

Returns the value associated with this developer metadata, or null if this metadata has no value.

Return

String — The value associated with this developer metadata, or null if this metadata has no value.

Authorization

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

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

getVisibility()

Returns the visibility of this developer metadata.

Return

DeveloperMetadataVisibility — The visibility of this developer metadata.

Authorization

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

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

moveToColumn(column)

Moves this developer metadata to the specified column. If the specified range does not represent a single column this throws an exception.

Parameters

NameTypeDescription
columnRangeThe range representing the column that is the new location for this developer metadata.

Return

DeveloperMetadata — The developer metadata, for chaining.

Authorization

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

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

moveToRow(row)

Moves this developer metadata to the specified row. If the specified range does not represent a single row this throws an exception.

Parameters

NameTypeDescription
rowRangeThe range representing the row that is the new location for this developer metadata.

Return

DeveloperMetadata — The developer metadata, for chaining.

Authorization

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

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

moveToSheet(sheet)

Moves this developer metadata to the specified sheet.

Parameters

NameTypeDescription
sheetSheetThe sheet that is the new location for this developer metata.

Return

DeveloperMetadata — The developer metadata, for chaining.

Authorization

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

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

moveToSpreadsheet()

Moves this developer metadata to the top-level spreadsheet.

Return

DeveloperMetadata — The developer metadata, for chaining.

Authorization

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

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

remove()

Deletes this metadata.

Authorization

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

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

setKey(key)

Sets the key of this developer metadata to the specified value.

Parameters

NameTypeDescription
keyStringThe new key to set for this metadata.

Return

DeveloperMetadata — The developer metadata, for chaining.

Authorization

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

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

setValue(value)

Sets the value associated with this developer metadata to the specified value.

Parameters

NameTypeDescription
valueStringThe new value to set for this metadata.

Return

DeveloperMetadata — The developer metadata, for chaining.

Authorization

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

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

setVisibility(visibility)

Sets the visibility of this developer metadata to the specified visibility.

Parameters

NameTypeDescription
visibilityDeveloperMetadataVisibilityThe new visibility to set for this metadata.

Return

DeveloperMetadata — The developer metadata, for chaining.

Authorization

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

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