Spreadsheet Service  |  Apps Script  |  Google for Developers

This service allows scripts to create, access, and modify Google Sheets files. See also the guide to storing data in spreadsheets.

Sometimes, spreadsheet operations are bundled together to improve performance, such as when doing multiple calls to a method. If you want to make sure that all pending changes are made right away, for instance to show users information as a script is executing, call SpreadsheetApp.flush().

Classes

NameBrief description
AutoFillSeriesAn enumeration of the types of series used to calculate auto-filled values.
BandingAccess and modify bandings, the color patterns applied to rows or columns of a range.
BandingThemeAn enumeration of banding themes.
BigQueryDataSourceSpecAccess the existing BigQuery data source specification.
BigQueryDataSourceSpecBuilderThe builder for BigQueryDataSourceSpecBuilder.
BooleanConditionAccess boolean conditions in ConditionalFormatRules.
BooleanCriteriaAn enumeration representing the boolean criteria that can be used in conditional format or filter.
BorderStyleStyles that can be set on a range using Range.setBorder(top, left, bottom, right, vertical, horizontal, color, style).
CellImageRepresents an image value in a cell.
CellImageBuilderBuilder for CellImage.
ColorA representation for a color.
ColorBuilderThe builder for ColorBuilder.
ConditionalFormatRuleAccess conditional formatting rules.
ConditionalFormatRuleBuilderBuilder for conditional format rules.
ContainerInfoAccess the chart's position within a sheet.
CopyPasteTypeAn enumeration of possible special paste types.
DataExecutionErrorCodeAn enumeration of data execution error codes.
DataExecutionStateAn enumeration of data execution states.
DataExecutionStatusThe data execution status.
DataSourceAccess and modify existing data source.
DataSourceChartAccess and modify an existing data source chart.
DataSourceColumnAccess and modify a data source column.
DataSourceFormulaAccess and modify existing data source formulas.
DataSourceParameterAccess existing data source parameters.
DataSourceParameterTypeAn enumeration of data source parameter types.
DataSourcePivotTableAccess and modify existing data source pivot table.
DataSourceRefreshScheduleAccess and modify an existing refresh schedule.
DataSourceRefreshScheduleFrequencyAccess a refresh schedule's frequency, which specifies how often and when to refresh.
DataSourceRefreshScopeAn enumeration of scopes for refreshes.
DataSourceSheetAccess and modify existing data source sheet.
DataSourceSheetFilterAccess and modify an existing data source sheet filter.
DataSourceSpecAccess the general settings of an existing data source spec.
DataSourceSpecBuilderThe builder for DataSourceSpec.
DataSourceTableAccess and modify existing data source table.
DataSourceTableColumnAccess and modify an existing column in a DataSourceTable.
DataSourceTableFilterAccess and modify an existing data source table filter.
DataSourceTypeAn enumeration of data source types.
DataValidationAccess data validation rules.
DataValidationBuilderBuilder for data validation rules.
DataValidationCriteriaAn enumeration representing the data validation criteria that can be set on a range.
DateTimeGroupingRuleAccess an existing date-time grouping rule.
DateTimeGroupingRuleTypeThe types of date-time grouping rule.
DeveloperMetadataAccess and modify developer metadata.
DeveloperMetadataFinderSearch for developer metadata in a spreadsheet.
DeveloperMetadataLocationAccess developer metadata location information.
DeveloperMetadataLocationTypeAn enumeration of the types of developer metadata location types.
DeveloperMetadataVisibilityAn enumeration of the types of developer metadata visibility.
DimensionAn enumeration of possible directions along which data can be stored in a spreadsheet.
DirectionAn enumeration representing the possible directions that one can move within a spreadsheet using the arrow keys.
DrawingRepresents a drawing over a sheet in a spreadsheet.
EmbeddedAreaChartBuilderBuilder for area charts.
EmbeddedBarChartBuilderBuilder for bar charts.
EmbeddedChartRepresents a chart that has been embedded into a spreadsheet.
EmbeddedChartBuilderBuilder used to edit an EmbeddedChart.
EmbeddedColumnChartBuilderBuilder for column charts.
EmbeddedComboChartBuilderBuilder for combo charts.
EmbeddedHistogramChartBuilderBuilder for histogram charts.
EmbeddedLineChartBuilderBuilder for line charts.
EmbeddedPieChartBuilderBuilder for pie charts.
EmbeddedScatterChartBuilderBuilder for scatter charts.
EmbeddedTableChartBuilderBuilder for table charts.
FilterUse this class to modify existing filters on Grid sheets, the default type of sheet.
FilterCriteriaUse this class to get information about or copy the criteria on existing filters.
FilterCriteriaBuilderBuilder for filter criteria.
FrequencyTypeAn enumeration of frequency types.
GradientConditionAccess gradient (color) conditions in ConditionalFormatRuleApis.
GroupAccess and modify spreadsheet groups.
GroupControlTogglePositionAn enumeration representing the possible positions that a group control toggle can have.
InterpolationTypeAn enumeration representing the interpolation options for calculating a value to be used in a GradientCondition in a ConditionalFormatRule.
LookerDataSourceSpecA DataSourceSpec which is used to access specifically the existing Looker data source specifications.
LookerDataSourceSpecBuilderThe builder for LookerDataSourceSpecBuilder.
NamedRangeCreate, access and modify named ranges in a spreadsheet.
OverGridImageRepresents an image over the grid in a spreadsheet.
PageProtectionAccess and modify protected sheets in the older version of Google Sheets.
PivotFilterAccess and modify pivot table filters.
PivotGroupAccess and modify pivot table breakout groups.
PivotGroupLimitAccess and modify pivot table group limit.
PivotTableAccess and modify pivot tables.
PivotTableSummarizeFunctionAn enumeration of functions that summarize pivot table data.
PivotValueAccess and modify value groups in pivot tables.
PivotValueDisplayTypeAn enumeration of ways to display a pivot value as a function of another value.
ProtectionAccess and modify protected ranges and sheets.
ProtectionTypeAn enumeration representing the parts of a spreadsheet that can be protected from edits.
RangeAccess and modify spreadsheet ranges.
RangeListA collection of one or more Range instances in the same sheet.
RecalculationIntervalAn enumeration representing the possible intervals used in spreadsheet recalculation.
RelativeDateAn enumeration representing the relative date options for calculating a value to be used in date-based BooleanCriteria.
RichTextValueA stylized text string used to represent cell text.
RichTextValueBuilderA builder for Rich Text values.
SelectionAccess the current active selection in the active sheet.
SheetAccess and modify spreadsheet sheets.
SheetTypeThe different types of sheets that can exist in a spreadsheet.
SlicerRepresents a slicer, which is used to filter ranges, charts and pivot tables in a non-collaborative manner.
SortOrderAn enumeration representing the sort order.
SortSpecThe sorting specification.
SpreadsheetAccess and modify Google Sheets files.
SpreadsheetAppAccess and create Google Sheets files.
SpreadsheetThemeAccess and modify existing themes.
TextDirectionAn enumerations of text directions.
TextFinderFind or replace text within a range, sheet or spreadsheet.
TextRotationAccess the text rotation settings for a cell.
TextStyleThe rendered style of text in a cell.
TextStyleBuilderA builder for text styles.
TextToColumnsDelimiterAn enumeration of the types of preset delimiters that can split a column of text into multiple columns.
ThemeColorA representation for a theme color.
ThemeColorTypeAn enum which describes various color entries supported in themes.
ValueTypeAn enumeration of value types returned by Range.getValue() and Range.getValues() from the Range class of the Spreadsheet service.
WrapStrategyAn enumeration of the strategies used to handle cell text wrapping.

AutoFillSeries

Properties

PropertyTypeDescription
DEFAULT_SERIESEnumDefault.
ALTERNATE_SERIESEnumAuto-filling with this setting results in the empty cells in the expanded range being filled with copies of the existing values.

Banding

BandingTheme

Properties

PropertyTypeDescription
LIGHT_GREYEnumA light grey banding theme.
CYANEnumA cyan banding theme.
GREENEnumA green banding theme.
YELLOWEnumA yellow banding theme.
ORANGEEnumAn orange banding theme.
BLUEEnumA blue banding theme.
TEALEnumA teal banding theme.
GREYEnumA grey banding theme.
BROWNEnumA brown banding theme.
LIGHT_GREENEnumA light green banding theme.
INDIGOEnumAn indigo banding theme.
PINKEnumA pink banding theme.

BigQueryDataSourceSpec

BigQueryDataSourceSpecBuilder

BooleanCondition

Methods

MethodReturn typeBrief description
getBackgroundObject()Color|nullGets the background color for this boolean condition.
getBold()Boolean|nullReturns true if this boolean condition bolds the text and returns false if this boolean condition removes bolding from the text.
getCriteriaType()BooleanCriteriaGets the rule's criteria type as defined in the BooleanCriteria enum.
getCriteriaValues()Object[]Gets an array of arguments for the rule's criteria.
getFontColorObject()Color|nullGets the font color for this boolean condition.
getItalic()Boolean|nullReturns true if this boolean condition italicises the text and returns false if this boolean condition removes italics from the text.
getStrikethrough()Boolean|nullReturns true if this boolean condition strikes through the text and returns false if this boolean condition removes strikethrough from the text.
getUnderline()Boolean|nullReturns true if this boolean condition underlines the text and returns false if this boolean condition removes underlining from the text.

BooleanCriteria

Properties

PropertyTypeDescription
CELL_EMPTYEnumThe criteria is met when a cell is empty.
CELL_NOT_EMPTYEnumThe criteria is met when a cell is not empty.
DATE_AFTEREnumThe criteria is met when a date is after the given value.
DATE_BEFOREEnumThe criteria is met when a date is before the given value.
DATE_EQUAL_TOEnumThe criteria is met when a date is equal to the given value.
DATE_NOT_EQUAL_TOEnumThe criteria is met when a date is not equal to the given value.
DATE_AFTER_RELATIVEEnumThe criteria is met when a date is after the relative date value.
DATE_BEFORE_RELATIVEEnumThe criteria is met when a date is before the relative date value.
DATE_EQUAL_TO_RELATIVEEnumThe criteria is met when a date is equal to the relative date value.
NUMBER_BETWEENEnumThe criteria is met when a number that is between the given values.
NUMBER_EQUAL_TOEnumThe criteria is met when a number that is equal to the given value.
NUMBER_GREATER_THANEnumThe criteria is met when a number that is greater than the given value.
NUMBER_GREATER_THAN_OR_EQUAL_TOEnumThe criteria is met when a number that is greater than or equal to the given value.
NUMBER_LESS_THANEnumThe criteria is met when a number that is less than the given value.
NUMBER_LESS_THAN_OR_EQUAL_TOEnumThe criteria is met when a number that is less than or equal to the given value.
NUMBER_NOT_BETWEENEnumThe criteria is met when a number that is not between the given values.
NUMBER_NOT_EQUAL_TOEnumThe criteria is met when a number that is not equal to the given value.
TEXT_CONTAINSEnumThe criteria is met when the input contains the given value.
TEXT_DOES_NOT_CONTAINEnumThe criteria is met when the input does not contain the given value.
TEXT_EQUAL_TOEnumThe criteria is met when the input is equal to the given value.
TEXT_NOT_EQUAL_TOEnumThe criteria is met when the input is not equal to the given value.
TEXT_STARTS_WITHEnumThe criteria is met when the input begins with the given value.
TEXT_ENDS_WITHEnumThe criteria is met when the input ends with the given value.
CUSTOM_FORMULAEnumThe criteria is met when the input makes the given formula evaluate to true.

BorderStyle

Properties

PropertyTypeDescription
DOTTEDEnumDotted line borders.
DASHEDEnumDashed line borders.
SOLIDEnumThin solid line borders.
SOLID_MEDIUMEnumMedium solid line borders.
SOLID_THICKEnumThick solid line borders.
DOUBLEEnumTwo solid line borders.

CellImage

Properties

PropertyTypeDescription
valueTypeValueTypeThe value type of the cell image, which is ValueType.IMAGE.

Methods

MethodReturn typeBrief description
getAltTextDescription()StringReturns the alt text description for this image.
getAltTextTitle()StringReturns the alt text title for this image.
getContentUrl()StringReturns a Google-hosted URL to the image.
toBuilder()CellImageBuilderCreates a cell image builder based on the current image properties.

CellImageBuilder

Color

ColorBuilder

ConditionalFormatRule

ConditionalFormatRuleBuilder

Methods

MethodReturn typeBrief description
build()ConditionalFormatRuleConstructs a conditional format rule from the settings applied to the builder.
copy()ConditionalFormatRuleBuilderReturns a rule builder preset with this rule's settings.
getBooleanCondition()BooleanCondition|nullRetrieves the rule's BooleanCondition information if this rule uses boolean condition criteria.
getGradientCondition()GradientCondition|nullRetrieves the rule's GradientCondition information, if this rule uses gradient condition criteria.
getRanges()Range[]Retrieves the ranges to which this conditional format rule is applied.
setBackground(color)ConditionalFormatRuleBuilderSets the background color for the conditional format rule's format.
setBackgroundObject(color)ConditionalFormatRuleBuilderSets the background color for the conditional format rule's format.
setBold(bold)ConditionalFormatRuleBuilderSets text bolding for the conditional format rule's format.
setFontColor(color)ConditionalFormatRuleBuilderSets the font color for the conditional format rule's format.
setFontColorObject(color)ConditionalFormatRuleBuilderSets the font color for the conditional format rule's format.
setGradientMaxpoint(color)ConditionalFormatRuleBuilderClears the conditional format rule's gradient maxpoint value, and instead uses the maximum value in the rule's ranges.
setGradientMaxpointObject(color)ConditionalFormatRuleBuilderClears the conditional format rule's gradient maxpoint value, and instead uses the maximum value in the rule's ranges.
setGradientMaxpointObjectWithValue(color, type, value)ConditionalFormatRuleBuilderSets the conditional format rule's gradient maxpoint fields.
setGradientMaxpointWithValue(color, type, value)ConditionalFormatRuleBuilderSets the conditional format rule's gradient maxpoint fields.
setGradientMidpointObjectWithValue(color, type, value)ConditionalFormatRuleBuilderSets the conditional format rule's gradient midpoint fields.
setGradientMidpointWithValue(color, type, value)ConditionalFormatRuleBuilderSets the conditional format rule's gradient midpoint fields.
setGradientMinpoint(color)ConditionalFormatRuleBuilderClears the conditional format rule's gradient minpoint value, and instead uses the minimum value in the rule's ranges.
setGradientMinpointObject(color)ConditionalFormatRuleBuilderClears the conditional format rule's gradient minpoint value, and instead uses the minimum value in the rule's ranges.
setGradientMinpointObjectWithValue(color, type, value)ConditionalFormatRuleBuilderSets the conditional format rule's gradient minpoint fields.
setGradientMinpointWithValue(color, type, value)ConditionalFormatRuleBuilderSets the conditional format rule's gradient minpoint fields.
setItalic(italic)ConditionalFormatRuleBuilderSets text italics for the conditional format rule's format.
setRanges(ranges)ConditionalFormatRuleBuilderSets one or more ranges to which this conditional format rule is applied.
setStrikethrough(strikethrough)ConditionalFormatRuleBuilderSets text strikethrough for the conditional format rule's format.
setUnderline(underline)ConditionalFormatRuleBuilderSets text underlining for the conditional format rule's format.
whenCellEmpty()ConditionalFormatRuleBuilderSets the conditional format rule to trigger when the cell is empty.
whenCellNotEmpty()ConditionalFormatRuleBuilderSets the conditional format rule to trigger when the cell is not empty.
whenDateAfter(date)ConditionalFormatRuleBuilderSets the conditional format rule to trigger when a date is after the given value.
whenDateAfter(date)ConditionalFormatRuleBuilderSets the conditional format rule to trigger when a date is after the given relative date.
whenDateBefore(date)ConditionalFormatRuleBuilderSets the conditional format rule to trigger when a date is before the given date.
whenDateBefore(date)ConditionalFormatRuleBuilderSets the conditional format rule to trigger when a date is before the given relative date.
whenDateEqualTo(date)ConditionalFormatRuleBuilderSets the conditional format rule to trigger when a date is equal to the given date.
whenDateEqualTo(date)ConditionalFormatRuleBuilderSets the conditional format rule to trigger when a date is equal to the given relative date.
whenFormulaSatisfied(formula)ConditionalFormatRuleBuilderSets the conditional format rule to trigger when that the given formula evaluates to true.
whenNumberBetween(start, end)ConditionalFormatRuleBuilderSets the conditional format rule to trigger when a number falls between, or is either of, two specified values.
whenNumberEqualTo(number)ConditionalFormatRuleBuilderSets the conditional format rule to trigger when a number is equal to the given value.
whenNumberGreaterThan(number)ConditionalFormatRuleBuilderSets the conditional format rule to trigger when a number is greater than the given value.
whenNumberGreaterThanOrEqualTo(number)ConditionalFormatRuleBuilderSets the conditional format rule to trigger when a number is greater than or equal to the given value.
whenNumberLessThan(number)ConditionalFormatRuleBuilderSets the conditional conditional format rule to trigger when a number less than the given value.
whenNumberLessThanOrEqualTo(number)ConditionalFormatRuleBuilderSets the conditional format rule to trigger when a number less than or equal to the given value.
whenNumberNotBetween(start, end)ConditionalFormatRuleBuilderSets the conditional format rule to trigger when a number does not fall between, and is neither of, two specified values.
whenNumberNotEqualTo(number)ConditionalFormatRuleBuilderSets the conditional format rule to trigger when a number is not equal to the given value.
whenTextContains(text)ConditionalFormatRuleBuilderSets the conditional format rule to trigger when that the input contains the given value.
whenTextDoesNotContain(text)ConditionalFormatRuleBuilderSets the conditional format rule to trigger when that the input does not contain the given value.
whenTextEndsWith(text)ConditionalFormatRuleBuilderSets the conditional format rule to trigger when that the input ends with the given value.
whenTextEqualTo(text)ConditionalFormatRuleBuilderSets the conditional format rule to trigger when that the input is equal to the given value.
whenTextStartsWith(text)ConditionalFormatRuleBuilderSets the conditional format rule to trigger when that the input starts with the given value.
withCriteria(criteria, args)ConditionalFormatRuleBuilderSets the conditional format rule to criteria defined by BooleanCriteria values, typically taken from the criteria and arguments of an existing rule.

ContainerInfo

Methods

MethodReturn typeBrief description
getAnchorColumn()IntegerThe chart's left side is anchored in this column.
getAnchorRow()IntegerThe chart's top side is anchored in this row.
getOffsetX()IntegerThe chart's upper left hand corner is offset from the anchor column by this many pixels.
getOffsetY()IntegerThe chart's upper left hand corner is offset from the anchor row by this many pixels.

CopyPasteType

Properties

PropertyTypeDescription
PASTE_NORMALEnumPaste values, formulas, formats and merges.
PASTE_NO_BORDERSEnumPaste values, formulas, formats and merges but without borders.
PASTE_FORMATEnumPaste the format only.
PASTE_FORMULAEnumPaste the formulas only.
PASTE_DATA_VALIDATIONEnumPaste the data validation only.
PASTE_VALUESEnumPaste the values ONLY without formats, formulas or merges.
PASTE_CONDITIONAL_FORMATTINGEnumPaste the color rules only.
PASTE_COLUMN_WIDTHSEnumPaste the column widths only.

DataExecutionErrorCode

Properties

PropertyTypeDescription
DATA_EXECUTION_ERROR_CODE_UNSUPPORTEDEnumA data execution error code that is not supported in Apps Script.
NONEEnumThe data execution has no error.
TIME_OUTEnumThe data execution timed out.
TOO_MANY_ROWSEnumThe data execution returns more rows than the limit.
TOO_MANY_COLUMNSEnumThe data execution returns more columns than the limit.
TOO_MANY_CELLSEnumThe data execution returns more cells than the limit.
ENGINEEnumData execution engine error.
PARAMETER_INVALIDEnumInvalid data execution parameter.
UNSUPPORTED_DATA_TYPEEnumThe data execution returns unsupported data type.
DUPLICATE_COLUMN_NAMESEnumThe data execution returns duplicate column names.
INTERRUPTEDEnumThe data execution is interrupted.
OTHEREnumOther errors.
TOO_MANY_CHARS_PER_CELLEnumThe data execution returns values that exceed the maximum characters allowed in a single cell.
DATA_NOT_FOUNDEnumThe database referenced by the data source is not found.
PERMISSION_DENIEDEnumThe user does not have access to the database referenced by the data source.

DataExecutionState

Properties

PropertyTypeDescription
DATA_EXECUTION_STATE_UNSUPPORTEDEnumA data execution state is not supported in Apps Script.
RUNNINGEnumThe data execution has started and is running.
SUCCESSEnumThe data execution is completed and successful.
ERROREnumThe data execution is completed and has errors.
NOT_STARTEDEnumThe data execution has not started.

DataExecutionStatus

DataSource

DataSourceChart

DataSourceColumn

DataSourceFormula

DataSourceParameter

DataSourceParameterType

Properties

PropertyTypeDescription
DATA_SOURCE_PARAMETER_TYPE_UNSUPPORTEDEnumA data source parameter type that is not supported in Apps Script.
CELLEnumThe data source parameter is valued based on a cell.

DataSourcePivotTable

DataSourceRefreshSchedule

DataSourceRefreshScheduleFrequency

DataSourceRefreshScope

Properties

PropertyTypeDescription
DATA_SOURCE_REFRESH_SCOPE_UNSUPPORTEDEnumThe data source refresh scope is unsupported.
ALL_DATA_SOURCESEnumThe refresh applies to all data sources in the spreadsheet.

DataSourceSheet

DataSourceSheetFilter

DataSourceSpec

DataSourceSpecBuilder

DataSourceTable

DataSourceTableColumn

DataSourceTableFilter

DataSourceType

Properties

PropertyTypeDescription
DATA_SOURCE_TYPE_UNSUPPORTEDEnumA data source type that is not supported in Apps Script.
BIGQUERYEnumA BigQuery data source.
LOOKEREnumA Looker data source.

DataValidation

DataValidationBuilder

Methods

MethodReturn typeBrief description
build()DataValidationConstructs a data validation rule from the settings applied to the builder.
copy()DataValidationBuilderCreates a builder for a data validation rule based on this rule's settings.
getAllowInvalid()BooleanReturns true if the rule shows a warning when input fails data validation, or false if it rejects the input entirely.
getCriteriaType()DataValidationCriteriaGets the rule's criteria type as defined in the DataValidationCriteria enum.
getCriteriaValues()Object[]Gets an array of arguments for the rule's criteria.
getHelpText()StringGets the rule's help text, or null if no help text is set.
requireCheckbox()DataValidationBuilderSets the data validation rule to require that the input is a boolean value; this value is rendered as a checkbox.
requireCheckbox(checkedValue)DataValidationBuilderSets the data validation rule to require that the input is the specified value or blank.
requireCheckbox(checkedValue, uncheckedValue)DataValidationBuilderSets the data validation rule to require that the input is one of the specified values.
requireDate()DataValidationBuilderSets the data validation rule to require a date.
requireDateAfter(date)DataValidationBuilderSets the data validation rule to require a date after the given value.
requireDateBefore(date)DataValidationBuilderSets the data validation rule to require a date before the given value.
requireDateBetween(start, end)DataValidationBuilderSets the data validation rule to require a date that falls between, or is either of, two specified dates.
requireDateEqualTo(date)DataValidationBuilderSets the data validation rule to require a date equal to the given value.
requireDateNotBetween(start, end)DataValidationBuilderSets the data validation rule to require a date that does not fall between, and is neither of, two specified dates.
requireDateOnOrAfter(date)DataValidationBuilderSets the data validation rule to require a date on or after the given value.
requireDateOnOrBefore(date)DataValidationBuilderSets the data validation rule to require a date on or before the given value.
requireFormulaSatisfied(formula)DataValidationBuilderSets the data validation rule to require that the given formula evaluates to true.
requireNumberBetween(start, end)DataValidationBuilderSets the data validation rule to require a number that falls between, or is either of, two specified numbers.
requireNumberEqualTo(number)DataValidationBuilderSets the data validation rule to require a number equal to the given value.
requireNumberGreaterThan(number)DataValidationBuilderSets the data validation rule to require a number greater than the given value.
requireNumberGreaterThanOrEqualTo(number)DataValidationBuilderSets the data validation rule to require a number greater than or equal to the given value.
requireNumberLessThan(number)DataValidationBuilderSets the data validation rule to require a number less than the given value.
requireNumberLessThanOrEqualTo(number)DataValidationBuilderSets the data validation rule to require a number less than or equal to the given value.
requireNumberNotBetween(start, end)DataValidationBuilderSets the data validation rule to require a number that does not fall between, and is neither of, two specified numbers.
requireNumberNotEqualTo(number)DataValidationBuilderSets the data validation rule to require a number not equal to the given value.
requireTextContains(text)DataValidationBuilderSets the data validation rule to require that the input contains the given value.
requireTextDoesNotContain(text)DataValidationBuilderSets the data validation rule to require that the input does not contain the given value.
requireTextEqualTo(text)DataValidationBuilderSets the data validation rule to require that the input is equal to the given value.
requireTextIsEmail()DataValidationBuilderSets the data validation rule to require that the input is in the form of an email address.
requireTextIsUrl()DataValidationBuilderSets the data validation rule to require that the input is in the form of a URL.
requireValueInList(values)DataValidationBuilderSets the data validation rule to require that the input is equal to one of the given values.
requireValueInList(values, showDropdown)DataValidationBuilderSets the data validation rule to require that the input is equal to one of the given values, with an option to hide the dropdown menu.
requireValueInRange(range)DataValidationBuilderSets the data validation rule to require that the input is equal to a value in the given range.
requireValueInRange(range, showDropdown)DataValidationBuilderSets the data validation rule to require that the input is equal to a value in the given range, with an option to hide the dropdown menu.
setAllowInvalid(allowInvalidData)DataValidationBuilderSets whether to show a warning when input fails data validation or whether to reject the input entirely.
setHelpText(helpText)DataValidationBuilderSets the help text that appears when the user hovers over the cell on which data validation is set.
withCriteria(criteria, args)DataValidationBuilderSets the data validation rule to criteria defined by DataValidationCriteria values, typically taken from the criteria and arguments of an existing rule.

DataValidationCriteria

Properties

PropertyTypeDescription
DATE_AFTEREnumRequires a date that is after the given value.
DATE_BEFOREEnumRequires a date that is before the given value.
DATE_BETWEENEnumRequires a date that is between the given values.
DATE_EQUAL_TOEnumRequires a date that is equal to the given value.
DATE_IS_VALID_DATEEnumRequires a date.
DATE_NOT_BETWEENEnumRequires a date that is not between the given values.
DATE_ON_OR_AFTEREnumRequire a date that is on or after the given value.
DATE_ON_OR_BEFOREEnumRequires a date that is on or before the given value.
NUMBER_BETWEENEnumRequires a number that is between the given values.
NUMBER_EQUAL_TOEnumRequires a number that is equal to the given value.
NUMBER_GREATER_THANEnumRequire a number that is greater than the given value.
NUMBER_GREATER_THAN_OR_EQUAL_TOEnumRequires a number that is greater than or equal to the given value.
NUMBER_LESS_THANEnumRequires a number that is less than the given value.
NUMBER_LESS_THAN_OR_EQUAL_TOEnumRequires a number that is less than or equal to the given value.
NUMBER_NOT_BETWEENEnumRequires a number that is not between the given values.
NUMBER_NOT_EQUAL_TOEnumRequires a number that is not equal to the given value.
TEXT_CONTAINSEnumRequires that the input contains the given value.
TEXT_DOES_NOT_CONTAINEnumRequires that the input does not contain the given value.
TEXT_EQUAL_TOEnumRequires that the input is equal to the given value.
TEXT_IS_VALID_EMAILEnumRequires that the input is in the form of an email address.
TEXT_IS_VALID_URLEnumRequires that the input is in the form of a URL.
VALUE_IN_LISTEnumRequires that the input is equal to one of the given values.
VALUE_IN_RANGEEnumRequires that the input is equal to a value in the given range.
CUSTOM_FORMULAEnumRequires that the input makes the given formula evaluate to true.
CHECKBOXEnumRequires that the input is a custom value or a boolean; rendered as a checkbox.
DATE_AFTER_RELATIVEEnumRequires a date that is after the relative date value.
DATE_BEFORE_RELATIVEEnumRequires a date that is before the relative date value.
DATE_EQUAL_TO_RELATIVEEnumRequires a date that is equal to the relative date value.

DateTimeGroupingRule

DateTimeGroupingRuleType

Properties

PropertyTypeDescription
UNSUPPORTEDEnumA date-time grouping rule type that is not supported.
SECONDEnumGroup date-time by second, from 0 to 59.
MINUTEEnumGroup date-time by minute, from 0 to 59.
HOUREnumGroup date-time by hour using a 24-hour system, from 0 to 23.
HOUR_MINUTEEnumGroup date-time by hour and minute using a 24-hour system, for example 19:45.
HOUR_MINUTE_AMPMEnumGroup date-time by hour and minute using a 12-hour system, for example 7:45 PM.
DAY_OF_WEEKEnumGroup date-time by day of week, for example Sunday.
DAY_OF_YEAREnumGroup date-time by day of year, from 1 to 366.
DAY_OF_MONTHEnumGroup date-time by day of month, from 1 to 31.
DAY_MONTHEnumGroup date-time by day and month, for example 22-Nov.
MONTHEnumGroup date-time by month, for example Nov.
QUARTEREnumGroup date-time by quarter, for example Q1 (which represents Jan-Mar).
YEAREnumGroup date-time by year, for example 2008.
YEAR_MONTHEnumGroup date-time by year and month, for example 2008-Nov.
YEAR_QUARTEREnumGroup date-time by year and quarter, for example 2008 Q4 .
YEAR_MONTH_DAYEnumGroup date-time by year, month, and day, for example 2008-11-22.

Methods

MethodReturn typeBrief description
getColumn()Range|nullReturns the Range for the column location of this metadata, or null if the location type is not DeveloperMetadataLocationType.COLUMN.
getLocationType()DeveloperMetadataLocationTypeGets the type of location.
getRow()Range|nullReturns the Range for the row location of this metadata, or null if the location type is not DeveloperMetadataLocationType.ROW.
getSheet()Sheet|nullReturns the Sheet location of this metadata, or null if the location type is not DeveloperMetadataLocationType.SHEET.
getSpreadsheet()Spreadsheet|nullReturns the Spreadsheet location of this metadata, or null if the location type is not DeveloperMetadataLocationType.SPREADSHEET.

Properties

PropertyTypeDescription
SPREADSHEETEnumThe location type for developer metadata associated with the top-level spreadsheet.
SHEETEnumThe location type for developer metadata associated with a whole sheet.
ROWEnumThe location type for developer metadata associated with a row.
COLUMNEnumThe location type for developer metadata associated with a column.

Properties

PropertyTypeDescription
DOCUMENTEnumDocument-visible metadata is accessible from any developer project with access to the document.
PROJECTEnumProject-visible metadata is only visible to and accessible by the developer project that created the metadata.

Dimension

Properties

PropertyTypeDescription
COLUMNSEnumThe column (vertical) dimension.
ROWSEnumThe row (horizontal) dimension.

Direction

Properties

PropertyTypeDescription
UPEnumThe direction of decreasing row indices.
DOWNEnumThe direction of increasing row indices.
PREVIOUSEnumThe direction of decreasing column indices.
NEXTEnumThe direction of increasing column indices.

Drawing

EmbeddedAreaChartBuilder

EmbeddedBarChartBuilder

EmbeddedChart

EmbeddedChartBuilder

EmbeddedColumnChartBuilder

EmbeddedComboChartBuilder

EmbeddedHistogramChartBuilder

EmbeddedLineChartBuilder

EmbeddedPieChartBuilder

EmbeddedScatterChartBuilder

EmbeddedTableChartBuilder

Methods

MethodReturn typeBrief description
addRange(range)EmbeddedChartBuilderAdds a range to the chart this builder modifies.
asAreaChart()EmbeddedAreaChartBuilderSets the chart type to AreaChart and returns an EmbeddedAreaChartBuilder.
asBarChart()EmbeddedBarChartBuilderSets the chart type to BarChart and returns an EmbeddedBarChartBuilder.
asColumnChart()EmbeddedColumnChartBuilderSets the chart type to ColumnChart and returns an EmbeddedColumnChartBuilder.
asComboChart()EmbeddedComboChartBuilderSets the chart type to ComboChart and returns an EmbeddedComboChartBuilder.
asHistogramChart()EmbeddedHistogramChartBuilderSets the chart type to HistogramChart and returns an EmbeddedHistogramChartBuilder.
asLineChart()EmbeddedLineChartBuilderSets the chart type to LineChart and returns an EmbeddedLineChartBuilder.
asPieChart()EmbeddedPieChartBuilderSets the chart type to PieChart and returns an EmbeddedPieChartBuilder.
asScatterChart()EmbeddedScatterChartBuilderSets the chart type to ScatterChart and returns an EmbeddedScatterChartBuilder.
asTableChart()EmbeddedTableChartBuilderSets the chart type to TableChart and returns an EmbeddedTableChartBuilder.
build()EmbeddedChartBuilds the chart to reflect all changes made to it.
clearRanges()EmbeddedChartBuilderRemoves all ranges from the chart this builder modifies.
enablePaging(enablePaging)EmbeddedTableChartBuilderSets whether to enable paging through the data.
enablePaging(pageSize)EmbeddedTableChartBuilderEnables paging and sets the number of rows in each page.
enablePaging(pageSize, startPage)EmbeddedTableChartBuilderEnables paging, sets the number of rows in each page and the first table page to display (page numbers are zero based).
enableRtlTable(rtlEnabled)EmbeddedTableChartBuilderAdds basic support for right-to-left languages (such as Arabic or Hebrew) by reversing the column order of the table, so that column zero is the right-most column, and the last column is the left-most column.
enableSorting(enableSorting)EmbeddedTableChartBuilderSets whether to sort columns when the user clicks a column heading.
getChartType()ChartTypeReturns the current chart type.
getContainer()ContainerInfoReturn the chart ContainerInfo, which encapsulates where the chart appears on the sheet.
getRanges()Range[]Returns a copy of the list of ranges currently providing data for this chart.
removeRange(range)EmbeddedChartBuilderRemoves the specified range from the chart this builder modifies.
setChartType(type)EmbeddedChartBuilderChanges the type of chart.
setFirstRowNumber(number)EmbeddedTableChartBuilderSets the row number for the first row in the data table.
setHiddenDimensionStrategy(strategy)EmbeddedChartBuilderSets the strategy to use for hidden rows and columns.
setInitialSortingAscending(column)EmbeddedTableChartBuilderSets the index of the column according to which the table should be initially sorted (ascending).
setInitialSortingDescending(column)EmbeddedTableChartBuilderSets the index of the column according to which the table should be initially sorted (descending).
setMergeStrategy(mergeStrategy)EmbeddedChartBuilderSets the merge strategy to use when more than one range exists.
setNumHeaders(headers)EmbeddedChartBuilderSets the number of rows or columns of the range that should be treated as headers.
setOption(option, value)EmbeddedChartBuilderSets advanced options for this chart.
setPosition(anchorRowPos, anchorColPos, offsetX, offsetY)EmbeddedChartBuilderSets the position, changing where the chart appears on the sheet.
setTransposeRowsAndColumns(transpose)EmbeddedChartBuilderSets whether the chart's rows and columns are transposed.
showRowNumberColumn(showRowNumber)EmbeddedTableChartBuilderSets whether to show the row number as the first column of the table.
useAlternatingRowStyle(alternate)EmbeddedTableChartBuilderSets whether alternating color style is assigned to odd and even rows of a table chart.

Filter

FilterCriteria

FilterCriteriaBuilder

Methods

MethodReturn typeBrief description
build()FilterCriteriaAssembles the filter criteria using the settings you add to the criteria builder.
copy()FilterCriteriaBuilderCopies this filter criteria and creates a criteria builder that you can apply to another filter.
getCriteriaType()BooleanCriteria|nullReturns the criteria's boolean type, for example, CELL_EMPTY.
getCriteriaValues()Object[]Returns an array of arguments for boolean criteria.
getHiddenValues()String[]Returns the values that the filter hides.
getVisibleBackgroundColor()Color|nullReturns the background color used as filter criteria.
getVisibleForegroundColor()Color|nullReturns the foreground color used as a filter criteria.
getVisibleValues()String[]Returns the values that the pivot table filter shows.
setHiddenValues(values)FilterCriteriaBuilderSets the values to hide.
setVisibleBackgroundColor(visibleBackgroundColor)FilterCriteriaBuilderSets the background color used as filter criteria.
setVisibleForegroundColor(visibleForegroundColor)FilterCriteriaBuilderSets the foreground color used as filter criteria.
setVisibleValues(values)FilterCriteriaBuilderSets the values to show on a pivot table.
whenCellEmpty()FilterCriteriaBuilderSets the filter criteria to show empty cells.
whenCellNotEmpty()FilterCriteriaBuilderSets the filter criteria to show cells that aren't empty.
whenDateAfter(date)FilterCriteriaBuilderSets filter criteria that shows cells with dates that are after the specified date.
whenDateAfter(date)FilterCriteriaBuilderSets filter criteria that shows cells with dates that are after the specified relative date.
whenDateBefore(date)FilterCriteriaBuilderSets filter criteria that shows cells with dates that are before the specified date.
whenDateBefore(date)FilterCriteriaBuilderSets filter criteria that shows cells with dates that are before the specified relative date.
whenDateEqualTo(date)FilterCriteriaBuilderSets filter criteria that shows cells with dates that are equal to the specified date.
whenDateEqualTo(date)FilterCriteriaBuilderSets filter criteria that shows cells with dates that are equal to the specified relative date.
whenDateEqualToAny(dates)FilterCriteriaBuilderSets the filter criteria to show cells with dates that are equal to any of the specified dates.
whenDateNotEqualTo(date)FilterCriteriaBuilderSets the filter criteria to show cells that aren't equal to the specified date.
whenDateNotEqualToAny(dates)FilterCriteriaBuilderSets the filter criteria to show cells with dates that aren't equal to any of the specified dates.
whenFormulaSatisfied(formula)FilterCriteriaBuilderSets the filter criteria to show cells with a specified formula (such as =B:B<C:C) that evaluates to true.
whenNumberBetween(start, end)FilterCriteriaBuilderSets the filter criteria to show cells with a number that falls between, or is either of, 2 specified numbers.
whenNumberEqualTo(number)FilterCriteriaBuilderSets the filter criteria to show cells with a number that's equal to the specified number.
whenNumberEqualToAny(numbers)FilterCriteriaBuilderSets the filter criteria to show cells with a number that's equal to any of the specified numbers.
whenNumberGreaterThan(number)FilterCriteriaBuilderSets the filter criteria to show cells with a number greater than the specified number
whenNumberGreaterThanOrEqualTo(number)FilterCriteriaBuilderSets the filter criteria to show cells with a number greater than or equal to the specified number.
whenNumberLessThan(number)FilterCriteriaBuilderSets the filter criteria to show cells with a number that's less than the specified number.
whenNumberLessThanOrEqualTo(number)FilterCriteriaBuilderSets the filter criteria to show cells with a number less than or equal to the specified number.
whenNumberNotBetween(start, end)FilterCriteriaBuilderSets the filter criteria to show cells with a number doesn't fall between, and is neither of, 2 specified numbers.
whenNumberNotEqualTo(number)FilterCriteriaBuilderSets the filter criteria to show cells with a number that isn't equal to the specified number.
whenNumberNotEqualToAny(numbers)FilterCriteriaBuilderSets the filter criteria to show cells with a number that isn't equal to any of the specified numbers.
whenTextContains(text)FilterCriteriaBuilderSets the filter criteria to show cells with text that contains the specified text.
whenTextDoesNotContain(text)FilterCriteriaBuilderSets the filter criteria to show cells with text that doesn't contain the specified text.
whenTextEndsWith(text)FilterCriteriaBuilderSets the filter criteria to show cells with text that ends with the specified text.
whenTextEqualTo(text)FilterCriteriaBuilderSets the filter criteria to show cells with text that's equal to the specified text.
whenTextEqualToAny(texts)FilterCriteriaBuilderSets the filter criteria to show cells with text that's equal to any of the specified text values.
whenTextNotEqualTo(text)FilterCriteriaBuilderSets the filter criteria to show cells with text that isn't equal to the specified text.
whenTextNotEqualToAny(texts)FilterCriteriaBuilderSets the filter criteria to show cells with text that isn't equal to any of the specified values.
whenTextStartsWith(text)FilterCriteriaBuilderSets the filter criteria to show cells with text that starts with the specified text.
withCriteria(criteria, args)FilterCriteriaBuilderSets the filter criteria to a boolean condition defined by BooleanCriteria values, such as CELL_EMPTY or NUMBER_GREATER_THAN.

FrequencyType

Properties

PropertyTypeDescription
FREQUENCY_TYPE_UNSUPPORTEDEnumThe frequency type is unsupported.
DAILYEnumRefresh daily.
WEEKLYEnumRefresh weekly, on given days of the week.
MONTHLYEnumRefresh monthly, on given days of the month.

GradientCondition

Group

GroupControlTogglePosition

Properties

PropertyTypeDescription
BEFOREEnumThe position where the control toggle is before the group (at lower indices).
AFTEREnumThe position where the control toggle is after the group (at higher indices).

InterpolationType

Properties

PropertyTypeDescription
NUMBEREnumUse the number as as specific interpolation point for a gradient condition.
PERCENTEnumUse the number as a percentage interpolation point for a gradient condition.
PERCENTILEEnumUse the number as a percentile interpolation point for a gradient condition.
MINEnumInfer the minimum number as a specific interpolation point for a gradient condition.
MAXEnumInfer the maximum number as a specific interpolation point for a gradient condition.

LookerDataSourceSpec

LookerDataSourceSpecBuilder

NamedRange

OverGridImage

PageProtection

PivotFilter

PivotGroup

PivotGroupLimit

PivotTable

PivotTableSummarizeFunction

Properties

PropertyTypeDescription
CUSTOMEnumA custom function, this value is only valid for calculated fields.
SUMEnumThe SUM function
COUNTAEnumThe COUNTA function
COUNTEnumThe COUNT function
COUNTUNIQUEEnumThe COUNTUNIQUE function
AVERAGEEnumThe AVERAGE function
MAXEnumThe MAX function
MINEnumThe MIN function
MEDIANEnumThe MEDIAN function
PRODUCTEnumThe PRODUCT function
STDEVEnumThe STDEV function
STDEVPEnumThe STDEVP function
VAREnumThe VAR function
VARPEnumThe VARP function

PivotValue

PivotValueDisplayType

Properties

PropertyTypeDescription
DEFAULTEnumDefault.
PERCENT_OF_ROW_TOTALEnumDisplays pivot values as a percent of the total for that row.
PERCENT_OF_COLUMN_TOTALEnumDisplays pivot values as a percent of the total for that column.
PERCENT_OF_GRAND_TOTALEnumDisplays pivot values as a percent of the grand total.

Protection

ProtectionType

Properties

PropertyTypeDescription
RANGEEnumProtection for a range.
SHEETEnumProtection for a sheet.

Range

Methods

MethodReturn typeBrief description
activate()RangeSets the specified range as the active range, with the top left cell in the range as the current cell.
activateAsCurrentCell()RangeSets the specified cell as the current cell.
addDeveloperMetadata(key)RangeAdds developer metadata with the specified key to the range.
addDeveloperMetadata(key, visibility)RangeAdds developer metadata with the specified key and visibility to the range.
addDeveloperMetadata(key, value)RangeAdds developer metadata with the specified key and value to the range.
addDeveloperMetadata(key, value, visibility)RangeAdds developer metadata with the specified key, value, and visibility to the range.
applyColumnBanding()BandingApplies a default column banding theme to the range.
applyColumnBanding(bandingTheme)BandingApplies a specified column banding theme to the range.
applyColumnBanding(bandingTheme, showHeader, showFooter)BandingApplies a specified column banding theme to the range with specified header and footer settings.
applyRowBanding()BandingApplies a default row banding theme to the range.
applyRowBanding(bandingTheme)BandingApplies a specified row banding theme to the range.
applyRowBanding(bandingTheme, showHeader, showFooter)BandingApplies a specified row banding theme to the range with specified header and footer settings.
autoFill(destination, series)voidFills the destinationRange with data based on the data in this range.
autoFillToNeighbor(series)voidCalculates a range to fill with new data based on neighboring cells and automatically fills that range with new values based on the data contained in this range.
breakApart()RangeBreak any multi-column cells in the range into individual cells again.
canEdit()BooleanDetermines whether the user has permission to edit every cell in the range.
check()RangeChanges the state of the checkboxes in the range to “checked”.
clear()RangeClears the range of contents and formats.
clear(options)RangeClears the range of contents, format, data validation rules, and/or comments, as specified with the given advanced options.
clearContent()RangeClears the content of the range, leaving the formatting intact.
clearDataValidations()RangeClears the data validation rules for the range.
clearFormat()RangeClears formatting for this range.
clearNote()RangeClears the note in the given cell or cells.
collapseGroups()RangeCollapses all groups that are wholly contained within the range.
copyFormatToRange(gridId, column, columnEnd, row, rowEnd)voidCopy the formatting of the range to the given location.
copyFormatToRange(sheet, column, columnEnd, row, rowEnd)voidCopy the formatting of the range to the given location.
copyTo(destination)voidCopies the data from a range of cells to another range of cells.
copyTo(destination, copyPasteType, transposed)voidCopies the data from a range of cells to another range of cells.
copyTo(destination, options)voidCopies the data from a range of cells to another range of cells.
copyValuesToRange(gridId, column, columnEnd, row, rowEnd)voidCopy the content of the range to the given location.
copyValuesToRange(sheet, column, columnEnd, row, rowEnd)voidCopy the content of the range to the given location.
createDataSourcePivotTable(dataSource)DataSourcePivotTableCreates an empty data source pivot table from the data source, anchored at the first cell in this range.
createDataSourceTable(dataSource)DataSourceTableCreates an empty data source table from the data source, anchored at the first cell in this range.
createDeveloperMetadataFinder()DeveloperMetadataFinderReturns a DeveloperMetadataFinderApi for finding developer metadata within the scope of this range.
createFilter()FilterCreates a filter and applies it to the specified range on the sheet.
createPivotTable(sourceData)PivotTableCreates an empty pivot table from the specified sourceData anchored at the first cell in this range.
createTextFinder(findText)TextFinderCreates a text finder for the range, which can find and replace text in this range.
deleteCells(shiftDimension)voidDeletes this range of cells.
expandGroups()RangeExpands the collapsed groups whose range or control toggle intersects with this range.
getA1Notation()StringReturns a string description of the range, in A1 notation.
getBackground()StringReturns the background color of the top-left cell in the range (for example, '#ffffff').
getBackgroundObject()ColorReturns the background color of the top-left cell in the range.
getBackgroundObjects()Color[][]Returns the background colors of the cells in the range.
getBackgrounds()String[][]Returns the background colors of the cells in the range (for example, '#ffffff').
getBandings()Banding[]Returns all the bandings that are applied to any cells in this range.
getCell(row, column)RangeReturns a given cell within a range.
getColumn()IntegerReturns the starting column position for this range.
getDataRegion()RangeReturns a copy of the range expanded in the four cardinal Directions to cover all adjacent cells with data in them.
getDataRegion(dimension)RangeReturns a copy of the range expanded Direction.UP and Direction.DOWN if the specified dimension is Dimension.ROWS, or Direction.NEXT and Direction.PREVIOUS if the dimension is Dimension.COLUMNS.
getDataSourceFormula()DataSourceFormula|nullReturns the DataSourceFormula for the first cell in the range, or null if the cell doesn't contain a data source formula.
getDataSourceFormulas()DataSourceFormula[]Returns the DataSourceFormulas for the cells in the range.
getDataSourcePivotTables()DataSourcePivotTable[]Gets all the data source pivot tables intersecting with the range.
getDataSourceTables()DataSourceTable[]Gets all the data source tables intersecting with the range.
getDataSourceUrl()StringReturns a URL for the data in this range, which can be used to create charts and queries.
getDataTable()DataTableReturn the data inside this object as a DataTable.
getDataTable(firstRowIsHeader)DataTableReturn the data inside this range as a DataTable.
getDataValidation()DataValidationReturns the data validation rule for the top-left cell in the range.
getDataValidations()DataValidation[][]Returns the data validation rules for all cells in the range.
getDeveloperMetadata()DeveloperMetadata[]Gets the developer metadata associated with this range.
getDisplayValue()StringReturns the displayed value of the top-left cell in the range.
getDisplayValues()String[][]Returns the rectangular grid of values for this range.
getFilter()Filter|nullReturns the filter on the sheet this range belongs to, or null if there is no filter on the sheet.
getFontColorObject()ColorReturns the font color of the cell in the top-left corner of the range.
getFontColorObjects()Color[][]Returns the font colors of the cells in the range.
getFontFamilies()String[][]Returns the font families of the cells in the range.
getFontFamily()StringReturns the font family of the cell in the top-left corner of the range.
getFontLine()StringGets the line style of the cell in the top-left corner of the range ('underline', 'line-through', or 'none').
getFontLines()String[][]Gets the line style of the cells in the range ('underline', 'line-through', or 'none').
getFontSize()IntegerReturns the font size in point size of the cell in the top-left corner of the range.
getFontSizes()Integer[][]Returns the font sizes of the cells in the range.
getFontStyle()StringReturns the font style ('italic' or 'normal') of the cell in the top-left corner of the range.
getFontStyles()String[][]Returns the font styles of the cells in the range.
getFontWeight()StringReturns the font weight (normal/bold) of the cell in the top-left corner of the range.
getFontWeights()String[][]Returns the font weights of the cells in the range.
getFormula()StringReturns the formula (A1 notation) for the top-left cell of the range, or an empty string if the cell is empty or doesn't contain a formula.
getFormulaR1C1()StringReturns the formula (R1C1 notation) for a given cell, or null if none.
getFormulas()String[][]Returns the formulas (A1 notation) for the cells in the range.
getFormulasR1C1()String[][]Returns the formulas (R1C1 notation) for the cells in the range.
getGridId()IntegerReturns the grid ID of the range's parent sheet.
getHeight()IntegerReturns the height of the range.
getHorizontalAlignment()StringReturns the horizontal alignment of the text (left/center/right) of the cell in the top-left corner of the range.
getHorizontalAlignments()String[][]Returns the horizontal alignments of the cells in the range.
getLastColumn()IntegerReturns the end column position.
getLastRow()IntegerReturns the end row position.
getMergedRanges()Range[]Returns an array of Range objects representing merged cells that either are fully within the current range, or contain at least one cell in the current range.
getNextDataCell(direction)RangeStarting at the cell in the first column and row of the range, returns the next cell in the given direction that is the edge of a contiguous range of cells with data in them or the cell at the edge of the spreadsheet in that direction.
getNote()StringReturns the note associated with the given range.
getNotes()String[][]Returns the notes associated with the cells in the range.
getNumColumns()IntegerReturns the number of columns in this range.
getNumRows()IntegerReturns the number of rows in this range.
getNumberFormat()StringGet the number or date formatting of the top-left cell of the given range.
getNumberFormats()String[][]Returns the number or date formats for the cells in the range.
getRichTextValue()RichTextValue|nullReturns the Rich Text value for the top left cell of the range, or null if the cell value is not text.
getRichTextValues()RichTextValue[][]Returns the Rich Text values for the cells in the range.
getRow()IntegerReturns the row position for this range.
getRowIndex()IntegerReturns the row position for this range.
getSheet()SheetReturns the sheet this range belongs to.
getTextDirection()TextDirectionReturns the text direction for the top left cell of the range.
getTextDirections()TextDirection[][]Returns the text directions for the cells in the range.
getTextRotation()TextRotationReturns the text rotation settings for the top left cell of the range.
getTextRotations()TextRotation[][]Returns the text rotation settings for the cells in the range.
getTextStyle()TextStyleReturns the text style for the top left cell of the range.
getTextStyles()TextStyle[][]Returns the text styles for the cells in the range.
getValue()ObjectReturns the value of the top-left cell in the range.
getValues()Object[][]Returns the rectangular grid of values for this range.
getVerticalAlignment()StringReturns the vertical alignment (top/middle/bottom) of the cell in the top-left corner of the range.
getVerticalAlignments()String[][]Returns the vertical alignments of the cells in the range.
getWidth()IntegerReturns the width of the range in columns.
getWrap()BooleanReturns whether the text in the cell wraps.
getWrapStrategies()WrapStrategy[][]Returns the text wrapping strategies for the cells in the range.
getWrapStrategy()WrapStrategyReturns the text wrapping strategy for the top left cell of the range.
getWraps()Boolean[][]Returns whether the text in the cells wrap.
insertCells(shiftDimension)RangeInserts empty cells into this range.
insertCheckboxes()RangeInserts checkboxes into each cell in the range, configured with true for checked and false for unchecked.
insertCheckboxes(checkedValue)RangeInserts checkboxes into each cell in the range, configured with a custom value for checked and the empty string for unchecked.
insertCheckboxes(checkedValue, uncheckedValue)RangeInserts checkboxes into each cell in the range, configured with custom values for the checked and unchecked states.
isBlank()BooleanReturns true if the range is totally blank.
isChecked()BooleanReturns whether all cells in the range have their checkbox state as 'checked'.
isEndColumnBounded()BooleanDetermines whether the end of the range is bound to a particular column.
isEndRowBounded()BooleanDetermines whether the end of the range is bound to a particular row.
isPartOfMerge()BooleanReturns true if the cells in the current range overlap any merged cells.
isStartColumnBounded()BooleanDetermines whether the start of the range is bound to a particular column.
isStartRowBounded()BooleanDetermines whether the start of the range is bound to a particular row.
merge()RangeMerges the cells in the range together into a single block.
mergeAcross()RangeMerge the cells in the range across the columns of the range.
mergeVertically()RangeMerges the cells in the range together.
moveTo(target)voidCut and paste (both format and values) from this range to the target range.
offset(rowOffset, columnOffset)RangeReturns a new range that is offset from this range by the given number of rows and columns (which can be negative).
offset(rowOffset, columnOffset, numRows)RangeReturns a new range that is relative to the current range, whose upper left point is offset from the current range by the given rows and columns, and with the given height in cells.
offset(rowOffset, columnOffset, numRows, numColumns)RangeReturns a new range that is relative to the current range, whose upper left point is offset from the current range by the given rows and columns, and with the given height and width in cells.
protect()ProtectionCreates an object that can protect the range from being edited except by users who have permission.
randomize()RangeRandomizes the order of the rows in the given range.
removeCheckboxes()RangeRemoves all checkboxes from the range.
removeDuplicates()RangeRemoves rows within this range that contain values that are duplicates of values in any previous row.
removeDuplicates(columnsToCompare)RangeRemoves rows within this range that contain values in the specified columns that are duplicates of values any previous row.
setBackground(color)RangeSets the background color of all cells in the range in CSS notation (such as '#ffffff' or 'white').
setBackgroundObject(color)RangeSets the background color of all cells in the range.
setBackgroundObjects(color)RangeSets a rectangular grid of background colors (must match dimensions of this range).
setBackgroundRGB(red, green, blue)RangeSets the background to the given color using RGB values (integers between 0 and 255 inclusive).
setBackgrounds(color)RangeSets a rectangular grid of background colors (must match dimensions of this range).
setBorder(top, left, bottom, right, vertical, horizontal)RangeSets the border property.
setBorder(top, left, bottom, right, vertical, horizontal, color, style)RangeSets the border property with color and/or style.
setDataValidation(rule)RangeSets one data validation rule for all cells in the range.
setDataValidations(rules)RangeSets the data validation rules for all cells in the range.
setFontColor(color)RangeSets the font color in CSS notation (such as '#ffffff' or 'white').
setFontColorObject(color)RangeSets the font color of the given range.
setFontColorObjects(colors)RangeSets a rectangular grid of font colors (must match dimensions of this range).
setFontColors(colors)RangeSets a rectangular grid of font colors (must match dimensions of this range).
setFontFamilies(fontFamilies)RangeSets a rectangular grid of font families (must match dimensions of this range).
setFontFamily(fontFamily)RangeSets the font family, such as "Arial" or "Helvetica".
setFontLine(fontLine)RangeSets the font line style of the given range ('underline', 'line-through', or 'none').
setFontLines(fontLines)RangeSets a rectangular grid of line styles (must match dimensions of this range).
setFontSize(size)RangeSets the font size, with the size being the point size to use.
setFontSizes(sizes)RangeSets a rectangular grid of font sizes (must match dimensions of this range).
setFontStyle(fontStyle)RangeSet the font style for the given range ('italic' or 'normal').
setFontStyles(fontStyles)RangeSets a rectangular grid of font styles (must match dimensions of this range).
setFontWeight(fontWeight)RangeSet the font weight for the given range (normal/bold).
setFontWeights(fontWeights)RangeSets a rectangular grid of font weights (must match dimensions of this range).
setFormula(formula)RangeUpdates the formula for this range.
setFormulaR1C1(formula)RangeUpdates the formula for this range.
setFormulas(formulas)RangeSets a rectangular grid of formulas (must match dimensions of this range).
setFormulasR1C1(formulas)RangeSets a rectangular grid of formulas (must match dimensions of this range).
setHorizontalAlignment(alignment)RangeSet the horizontal (left to right) alignment for the given range (left/center/right).
setHorizontalAlignments(alignments)RangeSets a rectangular grid of horizontal alignments.
setNote(note)RangeSets the note to the given value.
setNotes(notes)RangeSets a rectangular grid of notes (must match dimensions of this range).
setNumberFormat(numberFormat)RangeSets the number or date format to the given formatting string.
setNumberFormats(numberFormats)RangeSets a rectangular grid of number or date formats (must match dimensions of this range).
setRichTextValue(value)RangeSets the Rich Text value for the cells in the range.
setRichTextValues(values)RangeSets a rectangular grid of Rich Text values.
setShowHyperlink(showHyperlink)RangeSets whether or not the range should show hyperlinks.
setTextDirection(direction)RangeSets the text direction for the cells in the range.
setTextDirections(directions)RangeSets a rectangular grid of text directions.
setTextRotation(degrees)RangeSets the text rotation settings for the cells in the range.
setTextRotation(rotation)RangeSets the text rotation settings for the cells in the range.
setTextRotations(rotations)RangeSets a rectangular grid of text rotations.
setTextStyle(style)RangeSets the text style for the cells in the range.
setTextStyles(styles)RangeSets a rectangular grid of text styles.
setValue(value)RangeSets the value of the range.
setValues(values)RangeSets a rectangular grid of values (must match dimensions of this range).
setVerticalAlignment(alignment)RangeSet the vertical (top to bottom) alignment for the given range (top/middle/bottom).
setVerticalAlignments(alignments)RangeSets a rectangular grid of vertical alignments (must match dimensions of this range).
setVerticalText(isVertical)RangeSets whether or not to stack the text for the cells in the range.
setWrap(isWrapEnabled)RangeSet the cell wrap of the given range.
setWrapStrategies(strategies)RangeSets a rectangular grid of wrap strategies.
setWrapStrategy(strategy)RangeSets the text wrapping strategy for the cells in the range.
setWraps(isWrapEnabled)RangeSets a rectangular grid of word wrap policies (must match dimensions of this range).
shiftColumnGroupDepth(delta)RangeChanges the column grouping depth of the range by the specified amount.
shiftRowGroupDepth(delta)RangeChanges the row grouping depth of the range by the specified amount.
sort(sortSpecObj)RangeSorts the cells in the given range, by column and order specified.
splitTextToColumns()voidSplits a column of text into multiple columns based on an auto-detected delimiter.
splitTextToColumns(delimiter)voidSplits a column of text into multiple columns using the specified string as a custom delimiter.
splitTextToColumns(delimiter)voidSplits a column of text into multiple columns based on the specified delimiter.
trimWhitespace()RangeTrims the whitespace (such as spaces, tabs, or new lines) in every cell in this range.
uncheck()RangeChanges the state of the checkboxes in the range to “unchecked”.

RangeList

Methods

MethodReturn typeBrief description
activate()RangeListSelects the list of Range instances.
breakApart()RangeListBreak all horizontally- or vertically-merged cells contained within the range list into individual cells again.
check()RangeListChanges the state of the checkboxes in the range to “checked”.
clear()RangeListClears the range of contents, formats, and data validation rules for each Range in the range list.
clear(options)RangeListClears the range of contents, format, data validation rules, and comments, as specified with the given options.
clearContent()RangeListClears the content of each Range in the range list, leaving the formatting intact.
clearDataValidations()RangeListClears the data validation rules for each Range in the range list.
clearFormat()RangeListClears text formatting for each Range in the range list.
clearNote()RangeListClears the note for each Range in the range list.
getRanges()Range[]Returns a list of one or more Range instances in the same sheet.
insertCheckboxes()RangeListInserts checkboxes into each cell in the range, configured with true for checked and false for unchecked.
insertCheckboxes(checkedValue)RangeListInserts checkboxes into each cell in the range, configured with a custom value for checked and the empty string for unchecked.
insertCheckboxes(checkedValue, uncheckedValue)RangeListInserts checkboxes into each cell in the range, configured with custom values for the checked and unchecked states.
removeCheckboxes()RangeListRemoves all checkboxes from the range.
setBackground(color)RangeListSets the background color for each Range in the range list.
setBackgroundRGB(red, green, blue)RangeListSets the background to the given RGB color.
setBorder(top, left, bottom, right, vertical, horizontal)RangeListSets the border property for each Range in the range list.
setBorder(top, left, bottom, right, vertical, horizontal, color, style)RangeListSets the border property with color and/or style for each Range in the range list.
setFontColor(color)RangeListSets the font color for each Range in the range list.
setFontFamily(fontFamily)RangeListSets the font family for each Range in the range list.
setFontLine(fontLine)RangeListSets the font line style for each Range in the range list.
setFontSize(size)RangeListSets the font size (in points) for each Range in the range list.
setFontStyle(fontStyle)RangeListSet the font style for each Range in the range list.
setFontWeight(fontWeight)RangeListSet the font weight for each Range in the range list.
setFormula(formula)RangeListUpdates the formula for each Range in the range list.
setFormulaR1C1(formula)RangeListUpdates the formula for each Range in the range list.
setHorizontalAlignment(alignment)RangeListSet the horizontal alignment for each Range in the range list.
setNote(note)RangeListSets the note text for each Range in the range list.
setNumberFormat(numberFormat)RangeListSets the number or date format for each Range in the range list.
setShowHyperlink(showHyperlink)RangeListSets whether or not each Range in the range list should show hyperlinks.
setTextDirection(direction)RangeListSets the text direction for the cells in each Range in the range list.
setTextRotation(degrees)RangeListSets the text rotation settings for the cells in each Range in the range list.
setValue(value)RangeListSets the value for each Range in the range list.
setVerticalAlignment(alignment)RangeListSet the vertical alignment for each Range in the range list.
setVerticalText(isVertical)RangeListSets whether or not to stack the text for the cells for each Range in the range list.
setWrap(isWrapEnabled)RangeListSet text wrapping for each Range in the range list.
setWrapStrategy(strategy)RangeListSets the text wrapping strategy for each Range in the range list.
trimWhitespace()RangeListTrims the whitespace (such as spaces, tabs, or new lines) in every cell in this range list.
uncheck()RangeListChanges the state of the checkboxes in the range to “unchecked”.

RecalculationInterval

Properties

PropertyTypeDescription
ON_CHANGEEnumRecalculate only when values are changed.
MINUTEEnumRecalculate when values are changed, and every minute.
HOUREnumRecalculate when values are changed, and every hour.

RelativeDate

Properties

PropertyTypeDescription
TODAYEnumDates compared against the current date.
TOMORROWEnumDates compared against the date after the current date.
YESTERDAYEnumDates compared against the date before the current date.
PAST_WEEKEnumDates that fall within the past week period.
PAST_MONTHEnumDates that fall within the past month period.
PAST_YEAREnumDates that fall within the past year period.

RichTextValue

RichTextValueBuilder

Selection

Sheet

Methods

MethodReturn typeBrief description
activate()SheetActivates this sheet.
addDeveloperMetadata(key)SheetAdds developer metadata with the specified key to the sheet.
addDeveloperMetadata(key, visibility)SheetAdds developer metadata with the specified key and visibility to the sheet.
addDeveloperMetadata(key, value)SheetAdds developer metadata with the specified key and value to the sheet.
addDeveloperMetadata(key, value, visibility)SheetAdds developer metadata with the specified key, value, and visibility to the sheet.
appendRow(rowContents)SheetAppends a row to the bottom of the current data region in the sheet.
asDataSourceSheet()DataSourceSheet|nullReturns the sheet as a DataSourceSheet if the sheet is of type SheetType.DATASOURCE, or null otherwise.
autoResizeColumn(columnPosition)SheetSets the width of the given column to fit its contents.
autoResizeColumns(startColumn, numColumns)SheetSets the width of all columns starting at the given column position to fit their contents.
autoResizeRows(startRow, numRows)SheetSets the height of all rows starting at the given row position to fit their contents.
clear()SheetClears the sheet of content and formatting information.
clear(options)SheetClears the sheet of contents and/or format, as specified with the given advanced options.
clearConditionalFormatRules()voidRemoves all conditional format rules from the sheet.
clearContents()SheetClears the sheet of contents, while preserving formatting information.
clearFormats()SheetClears the sheet of formatting, while preserving contents.
clearNotes()SheetClears the sheet of all notes.
collapseAllColumnGroups()SheetCollapses all column groups on the sheet.
collapseAllRowGroups()SheetCollapses all row groups on the sheet.
copyTo(spreadsheet)SheetCopies the sheet to a given spreadsheet, which can be the same spreadsheet as the source.
createDeveloperMetadataFinder()DeveloperMetadataFinderReturns a DeveloperMetadataFinder for finding developer metadata within the scope of this sheet.
createTextFinder(findText)TextFinderCreates a text finder for the sheet, which can find and replace text within the sheet.
deleteColumn(columnPosition)SheetDeletes the column at the given column position.
deleteColumns(columnPosition, howMany)voidDeletes a number of columns starting at the given column position.
deleteRow(rowPosition)SheetDeletes the row at the given row position.
deleteRows(rowPosition, howMany)voidDeletes a number of rows starting at the given row position.
expandAllColumnGroups()SheetExpands all column groups on the sheet.
expandAllRowGroups()SheetExpands all row groups on the sheet.
expandColumnGroupsUpToDepth(groupDepth)SheetExpands all column groups up to the given depth, and collapses all others.
expandRowGroupsUpToDepth(groupDepth)SheetExpands all row groups up to the given depth, and collapses all others.
getActiveCell()RangeReturns the active cell in this sheet.
getActiveRange()RangeReturns the selected range in the active sheet, or null if there is no active range.
getActiveRangeList()RangeList|nullReturns the list of active ranges in the active sheet or null if there are no active ranges.
getBandings()Banding[]Returns all the bandings in this sheet.
getCharts()EmbeddedChart[]Returns an array of charts on this sheet.
getColumnGroup(columnIndex, groupDepth)Group|nullReturns the column group at the given index and group depth.
getColumnGroupControlPosition()GroupControlTogglePositionReturns the GroupControlTogglePosition for all column groups on the sheet.
getColumnGroupDepth(columnIndex)IntegerReturns the group depth of the column at the given index.
getColumnWidth(columnPosition)IntegerGets the width in pixels of the given column.
getConditionalFormatRules()ConditionalFormatRule[]Get all conditional format rules in this sheet.
getCurrentCell()Range|nullReturns the current cell in the active sheet or null if there is no current cell.
getDataRange()RangeReturns a Range corresponding to the dimensions in which data is present.
getDataSourceFormulas()DataSourceFormula[]Gets all the data source formulas.
getDataSourcePivotTables()DataSourcePivotTable[]Gets all the data source pivot tables.
getDataSourceTables()DataSourceTable[]Gets all the data source tables.
getDeveloperMetadata()DeveloperMetadata[]Get all developer metadata associated with this sheet.
getDrawings()Drawing[]Returns an array of drawings on the sheet.
getFilter()Filter|nullReturns the filter in this sheet, or null if there is no filter.
getFormUrl()String|nullReturns the URL for the form that sends its responses to this sheet, or null if this sheet has no associated form.
getFrozenColumns()IntegerReturns the number of frozen columns.
getFrozenRows()IntegerReturns the number of frozen rows.
getImages()OverGridImage[]Returns all over-the-grid images on the sheet.
getIndex()IntegerGets the position of the sheet in its parent spreadsheet.
getLastColumn()IntegerReturns the position of the last column that has content.
getLastRow()IntegerReturns the position of the last row that has content.
getMaxColumns()IntegerReturns the current number of columns in the sheet, regardless of content.
getMaxRows()IntegerReturns the current number of rows in the sheet, regardless of content.
getName()StringReturns the name of the sheet.
getNamedRanges()NamedRange[]Gets all the named ranges in this sheet.
getParent()SpreadsheetReturns the Spreadsheet that contains this sheet.
getPivotTables()PivotTable[]Returns all the pivot tables on this sheet.
getProtections(type)Protection[]Gets an array of objects representing all protected ranges in the sheet, or a single-element array representing the protection on the sheet itself.
getRange(row, column)RangeReturns the range with the top left cell at the given coordinates.
getRange(row, column, numRows)RangeReturns the range with the top left cell at the given coordinates, and with the given number of rows.
getRange(row, column, numRows, numColumns)RangeReturns the range with the top left cell at the given coordinates with the given number of rows and columns.
getRange(a1Notation)RangeReturns the range as specified in A1 notation or R1C1 notation.
getRangeList(a1Notations)RangeListReturns the RangeList collection representing the ranges in the same sheet specified by a non-empty list of A1 notations or R1C1 notations.
getRowGroup(rowIndex, groupDepth)Group|nullReturns the row group at the given index and group depth.
getRowGroupControlPosition()GroupControlTogglePositionReturns the GroupControlTogglePosition for all row groups on the sheet.
getRowGroupDepth(rowIndex)IntegerReturns the group depth of the row at the given index.
getRowHeight(rowPosition)IntegerGets the height in pixels of the given row.
getSelection()SelectionReturns the current Selection in the spreadsheet.
getSheetId()IntegerReturns the ID of the sheet represented by this object.
getSheetName()StringReturns the sheet name.
getSheetValues(startRow, startColumn, numRows, numColumns)Object[][]Returns the rectangular grid of values for this range starting at the given coordinates.
getSlicers()Slicer[]Returns an array of slicers on the sheet.
getTabColorObject()Color|nullGets the sheet tab color, or null if the sheet tab has no color.
getType()SheetTypeReturns the type of the sheet.
hasHiddenGridlines()BooleanReturns true if the sheet's gridlines are hidden; otherwise returns false.
hideColumn(column)voidHides the column or columns in the given range.
hideColumns(columnIndex)voidHides a single column at the given index.
hideColumns(columnIndex, numColumns)voidHides one or more consecutive columns starting at the given index.
hideRow(row)voidHides the rows in the given range.
hideRows(rowIndex)voidHides the row at the given index.
hideRows(rowIndex, numRows)voidHides one or more consecutive rows starting at the given index.
hideSheet()SheetHides this sheet.
insertChart(chart)voidAdds a new chart to this sheet.
insertColumnAfter(afterPosition)SheetInserts a column after the given column position.
insertColumnBefore(beforePosition)SheetInserts a column before the given column position.
insertColumns(columnIndex)voidInserts a blank column in a sheet at the specified location.
insertColumns(columnIndex, numColumns)voidInserts one or more consecutive blank columns in a sheet starting at the specified location.
insertColumnsAfter(afterPosition, howMany)SheetInserts a given number of columns after the given column position.
insertColumnsBefore(beforePosition, howMany)SheetInserts a number of columns before the given column position.
insertImage(blobSource, column, row)OverGridImageInserts a BlobSource as an image in the document at a given row and column.
insertImage(blobSource, column, row, offsetX, offsetY)OverGridImageInserts a BlobSource as an image in the document at a given row and column, with a pixel offset.
insertImage(url, column, row)OverGridImageInserts an image in the document at a given row and column.
insertImage(url, column, row, offsetX, offsetY)OverGridImageInserts an image in the document at a given row and column, with a pixel offset.
insertRowAfter(afterPosition)SheetInserts a row after the given row position.
insertRowBefore(beforePosition)SheetInserts a row before the given row position.
insertRows(rowIndex)voidInserts a blank row in a sheet at the specified location.
insertRows(rowIndex, numRows)voidInserts one or more consecutive blank rows in a sheet starting at the specified location.
insertRowsAfter(afterPosition, howMany)SheetInserts a number of rows after the given row position.
insertRowsBefore(beforePosition, howMany)SheetInserts a number of rows before the given row position.
insertSlicer(range, anchorRowPos, anchorColPos)SlicerAdds a new slicer to this sheet.
insertSlicer(range, anchorRowPos, anchorColPos, offsetX, offsetY)SlicerAdds a new slicer to this sheet.
isColumnHiddenByUser(columnPosition)BooleanReturns whether the given column is hidden by the user.
isRightToLeft()BooleanReturns true if this sheet layout is right-to-left.
isRowHiddenByFilter(rowPosition)BooleanReturns whether the given row is hidden by a filter (not a filter view).
isRowHiddenByUser(rowPosition)BooleanReturns whether the given row is hidden by the user.
isSheetHidden()BooleanReturns true if the sheet is currently hidden.
moveColumns(columnSpec, destinationIndex)voidMoves the columns selected by the given range to the position indicated by the destinationIndex.
moveRows(rowSpec, destinationIndex)voidMoves the rows selected by the given range to the position indicated by the destinationIndex.
newChart()EmbeddedChartBuilderReturns a builder to create a new chart for this sheet.
protect()ProtectionCreates an object that can protect the sheet from being edited except by users who have permission.
removeChart(chart)voidRemoves a chart from the parent sheet.
setActiveRange(range)RangeSets the specified range as the active range in the active sheet, with the top left cell in the range as the current cell.
setActiveRangeList(rangeList)RangeListSets the specified list of ranges as the active ranges in the active sheet.
setActiveSelection(range)RangeSets the active selection region for this sheet.
setActiveSelection(a1Notation)RangeSets the active selection, as specified in A1 notation or R1C1 notation.
setColumnGroupControlPosition(position)SheetSets the position of the column group control toggle on the sheet.
setColumnWidth(columnPosition, width)SheetSets the width of the given column in pixels.
setColumnWidths(startColumn, numColumns, width)SheetSets the width of the given columns in pixels.
setConditionalFormatRules(rules)voidReplaces all currently existing conditional format rules in the sheet with the input rules.
setCurrentCell(cell)RangeSets the specified cell as the current cell.
setFrozenColumns(columns)voidFreezes the given number of columns.
setFrozenRows(rows)voidFreezes the given number of rows.
setHiddenGridlines(hideGridlines)SheetHides or reveals the sheet gridlines.
setName(name)SheetSets the sheet name.
setRightToLeft(rightToLeft)SheetSets or unsets the sheet layout to right-to-left.
setRowGroupControlPosition(position)SheetSets the position of the row group control toggle on the sheet.
setRowHeight(rowPosition, height)SheetSets the row height of the given row in pixels.
setRowHeights(startRow, numRows, height)SheetSets the height of the given rows in pixels.
setRowHeightsForced(startRow, numRows, height)SheetSets the height of the given rows in pixels.
setTabColor(color)SheetSets the sheet tab color.
setTabColorObject(color)SheetSets the sheet tab color.
showColumns(columnIndex)voidUnhides the column at the given index.
showColumns(columnIndex, numColumns)voidUnhides one or more consecutive columns starting at the given index.
showRows(rowIndex)voidUnhides the row at the given index.
showRows(rowIndex, numRows)voidUnhides one or more consecutive rows starting at the given index.
showSheet()SheetMakes the sheet visible.
sort(columnPosition)SheetSorts a sheet by column, ascending.
sort(columnPosition, ascending)SheetSorts a sheet by column.
unhideColumn(column)voidUnhides the column in the given range.
unhideRow(row)voidUnhides the row in the given range.
updateChart(chart)voidUpdates the chart on this sheet.

SheetType

Properties

PropertyTypeDescription
GRIDEnumA sheet containing a grid.
OBJECTEnumA sheet containing a single embedded object such as an EmbeddedChart.
DATASOURCEEnumA sheet containing a DataSource.

Slicer

SortOrder

Properties

PropertyTypeDescription
ASCENDINGEnumAscending sort order.
DESCENDINGEnumDescending sort order.

SortSpec

Methods

MethodReturn typeBrief description
addDeveloperMetadata(key)SpreadsheetAdds developer metadata with the specified key to the top-level spreadsheet.
addDeveloperMetadata(key, visibility)SpreadsheetAdds developer metadata with the specified key and visibility to the spreadsheet.
addDeveloperMetadata(key, value)SpreadsheetAdds developer metadata with the specified key and value to the spreadsheet.
addDeveloperMetadata(key, value, visibility)SpreadsheetAdds developer metadata with the specified key, value, and visibility to the spreadsheet.
addEditor(emailAddress)SpreadsheetAdds the given user to the list of editors for the Spreadsheet.
addEditor(user)SpreadsheetAdds the given user to the list of editors for the Spreadsheet.
addEditors(emailAddresses)SpreadsheetAdds the given array of users to the list of editors for the Spreadsheet.
addMenu(name, subMenus)voidCreates a new menu in the Spreadsheet UI.
addViewer(emailAddress)SpreadsheetAdds the given user to the list of viewers for the Spreadsheet.
addViewer(user)SpreadsheetAdds the given user to the list of viewers for the Spreadsheet.
addViewers(emailAddresses)SpreadsheetAdds the given array of users to the list of viewers for the Spreadsheet.
appendRow(rowContents)SheetAppends a row to the bottom of the current data region in the sheet.
autoResizeColumn(columnPosition)SheetSets the width of the given column to fit its contents.
copy(name)SpreadsheetCopies the spreadsheet and returns the new one.
createDeveloperMetadataFinder()DeveloperMetadataFinderReturns a DeveloperMetadataFinder for finding developer metadata within the scope of this spreadsheet.
createTextFinder(findText)TextFinderCreates a text finder for the spreadsheet, which can be used to find and replace text within the spreadsheet.
deleteActiveSheet()SheetDeletes the currently active sheet.
deleteColumn(columnPosition)SheetDeletes the column at the given column position.
deleteColumns(columnPosition, howMany)voidDeletes a number of columns starting at the given column position.
deleteRow(rowPosition)SheetDeletes the row at the given row position.
deleteRows(rowPosition, howMany)voidDeletes a number of rows starting at the given row position.
deleteSheet(sheet)voidDeletes the specified sheet.
duplicateActiveSheet()SheetDuplicates the active sheet and makes it the active sheet.
getActiveCell()RangeReturns the active cell in this sheet.
getActiveRange()RangeReturns the selected range in the active sheet, or null if there is no active range.
getActiveRangeList()RangeList|nullReturns the list of active ranges in the active sheet or null if there are no active ranges.
getActiveSheet()SheetGets the active sheet in a spreadsheet.
getAs(contentType)BlobReturn the data inside this object as a blob converted to the specified content type.
getBandings()Banding[]Returns all the bandings in this spreadsheet.
getBlob()BlobReturn the data inside this object as a blob.
getColumnWidth(columnPosition)IntegerGets the width in pixels of the given column.
getCurrentCell()Range|nullReturns the current cell in the active sheet or null if there is no current cell.
getDataRange()RangeReturns a Range corresponding to the dimensions in which data is present.
getDataSourceFormulas()DataSourceFormula[]Gets all the data source formulas.
getDataSourcePivotTables()DataSourcePivotTable[]Gets all the data source pivot tables.
getDataSourceRefreshSchedules()DataSourceRefreshSchedule[]Gets the refresh schedules of this spreadsheet.
getDataSourceSheets()DataSourceSheet[]Returns all the data source sheets in the spreadsheet.
getDataSourceTables()DataSourceTable[]Gets all the data source tables.
getDataSources()DataSource[]Returns all the data sources in the spreadsheet.
getDeveloperMetadata()DeveloperMetadata[]Gets the developer metadata associated with the top-level spreadsheet.
getEditors()User[]Gets the list of editors for this Spreadsheet.
getFormUrl()StringReturns the URL for the form that sends its responses to this spreadsheet, or null if this spreadsheet has no associated form.
getFrozenColumns()IntegerReturns the number of frozen columns.
getFrozenRows()IntegerReturns the number of frozen rows.
getId()StringGets a unique identifier for this spreadsheet.
getImages()OverGridImage[]Returns all over-the-grid images on the sheet.
getIterativeCalculationConvergenceThreshold()NumberReturns the threshold value used during iterative calculation.
getLastColumn()IntegerReturns the position of the last column that has content.
getLastRow()IntegerReturns the position of the last row that has content.
getMaxIterativeCalculationCycles()IntegerReturns the maximum number of iterations to use during iterative calculation.
getName()StringGets the name of the document.
getNamedRanges()NamedRange[]Gets all the named ranges in this spreadsheet.
getNumSheets()IntegerReturns the number of sheets in this spreadsheet.
getOwner()UserReturns the owner of the document, or null for a document in a shared drive.
getPredefinedSpreadsheetThemes()SpreadsheetTheme[]Returns the list of predefined themes.
getProtections(type)Protection[]Gets an array of objects representing all protected ranges or sheets in the spreadsheet.
getRange(a1Notation)RangeReturns the range as specified in A1 notation or R1C1 notation.
getRangeByName(name)RangeReturns a named range, or null if no range with the given name is found.
getRangeList(a1Notations)RangeListReturns the RangeList collection representing the ranges in the same sheet specified by a non-empty list of A1 notations or R1C1 notations.
getRecalculationInterval()RecalculationIntervalReturns the calculation interval for this spreadsheet.
getRowHeight(rowPosition)IntegerGets the height in pixels of the given row.
getSelection()SelectionReturns the current Selection in the spreadsheet.
getSheetById(id)Sheet|nullGets the sheet with the given ID.
getSheetByName(name)SheetReturns a sheet with the given name.
getSheetId()IntegerReturns the ID of the sheet represented by this object.
getSheetName()StringReturns the sheet name.
getSheetValues(startRow, startColumn, numRows, numColumns)Object[][]Returns the rectangular grid of values for this range starting at the given coordinates.
getSheets()Sheet[]Gets all the sheets in this spreadsheet.
getSpreadsheetLocale()StringGets the spreadsheet locale.
getSpreadsheetTheme()SpreadsheetTheme|nullReturns the current theme of the spreadsheet, or null if no theme is applied.
getSpreadsheetTimeZone()StringGets the time zone for the spreadsheet.
getUrl()StringReturns the URL for the given spreadsheet.
getViewers()User[]Gets the list of viewers and commenters for this Spreadsheet.
hideColumn(column)voidHides the column or columns in the given range.
hideRow(row)voidHides the rows in the given range.
insertColumnAfter(afterPosition)SheetInserts a column after the given column position.
insertColumnBefore(beforePosition)SheetInserts a column before the given column position.
insertColumnsAfter(afterPosition, howMany)SheetInserts a given number of columns after the given column position.
insertColumnsBefore(beforePosition, howMany)SheetInserts a number of columns before the given column position.
insertDataSourceSheet(spec)DataSourceSheetInserts a new DataSourceSheet in the spreadsheet and starts data execution.
insertImage(blobSource, column, row)OverGridImageInserts a Spreadsheet as an image in the document at a given row and column.
insertImage(blobSource, column, row, offsetX, offsetY)OverGridImageInserts a Spreadsheet as an image in the document at a given row and column, with a pixel offset.
insertImage(url, column, row)OverGridImageInserts an image in the document at a given row and column.
insertImage(url, column, row, offsetX, offsetY)OverGridImageInserts an image in the document at a given row and column, with a pixel offset.
insertRowAfter(afterPosition)SheetInserts a row after the given row position.
insertRowBefore(beforePosition)SheetInserts a row before the given row position.
insertRowsAfter(afterPosition, howMany)SheetInserts a number of rows after the given row position.
insertRowsBefore(beforePosition, howMany)SheetInserts a number of rows before the given row position.
insertSheet()SheetInserts a new sheet into the spreadsheet, using a default sheet name.
insertSheet(sheetIndex)SheetInserts a new sheet into the spreadsheet at the given index.
insertSheet(sheetIndex, options)SheetInserts a new sheet into the spreadsheet at the given index and uses optional advanced arguments.
insertSheet(options)SheetInserts a new sheet into the spreadsheet, using a default sheet name and optional advanced arguments.
insertSheet(sheetName)SheetInserts a new sheet into the spreadsheet with the given name.
insertSheet(sheetName, sheetIndex)SheetInserts a new sheet into the spreadsheet with the given name at the given index.
insertSheet(sheetName, sheetIndex, options)SheetInserts a new sheet into the spreadsheet with the given name at the given index and uses optional advanced arguments.
insertSheet(sheetName, options)SheetInserts a new sheet into the spreadsheet with the given name and uses optional advanced arguments.
insertSheetWithDataSourceTable(spec)SheetInserts a new sheet in the spreadsheet, creates a DataSourceTable spanning the entire sheet with the given data source specification, and starts data execution.
isColumnHiddenByUser(columnPosition)BooleanReturns whether the given column is hidden by the user.
isIterativeCalculationEnabled()BooleanReturns whether iterative calculation is activated in this spreadsheet.
isRowHiddenByFilter(rowPosition)BooleanReturns whether the given row is hidden by a filter (not a filter view).
isRowHiddenByUser(rowPosition)BooleanReturns whether the given row is hidden by the user.
moveActiveSheet(pos)voidMoves the active sheet to the given position in the list of sheets.
moveChartToObjectSheet(chart)SheetCreates a new SheetType.OBJECT sheet and moves the provided chart to it.
refreshAllDataSources()voidRefreshes all supported data sources and their linked data source objects, skipping invalid data source objects.
removeEditor(emailAddress)SpreadsheetRemoves the given user from the list of editors for the Spreadsheet.
removeEditor(user)SpreadsheetRemoves the given user from the list of editors for the Spreadsheet.
removeMenu(name)voidRemoves a menu that was added by addMenu(name, subMenus).
removeNamedRange(name)voidDeletes a named range with the given name.
removeViewer(emailAddress)SpreadsheetRemoves the given user from the list of viewers and commenters for the Spreadsheet.
removeViewer(user)SpreadsheetRemoves the given user from the list of viewers and commenters for the Spreadsheet.
rename(newName)voidRenames the document.
renameActiveSheet(newName)voidRenames the current active sheet to the given new name.
resetSpreadsheetTheme()SpreadsheetThemeRemoves the applied theme and sets the default theme on the spreadsheet.
setActiveRange(range)RangeSets the specified range as the active range in the active sheet, with the top left cell in the range as the current cell.
setActiveRangeList(rangeList)RangeListSets the specified list of ranges as the active ranges in the active sheet.
setActiveSelection(range)RangeSets the active selection region for this sheet.
setActiveSelection(a1Notation)RangeSets the active selection, as specified in A1 notation or R1C1 notation.
setActiveSheet(sheet)SheetSets the given sheet to be the active sheet in the spreadsheet.
setActiveSheet(sheet, restoreSelection)SheetSets the given sheet to be the active sheet in the spreadsheet, with an option to restore the most recent selection within that sheet.
setColumnWidth(columnPosition, width)SheetSets the width of the given column in pixels.
setCurrentCell(cell)RangeSets the specified cell as the current cell.
setFrozenColumns(columns)voidFreezes the given number of columns.
setFrozenRows(rows)voidFreezes the given number of rows.
setIterativeCalculationConvergenceThreshold(minThreshold)SpreadsheetSets the minimum threshold value for iterative calculation.
setIterativeCalculationEnabled(isEnabled)SpreadsheetSets whether iterative calculation is activated in this spreadsheet.
setMaxIterativeCalculationCycles(maxIterations)SpreadsheetSets the maximum number of calculation iterations that should be performed during iterative calculation.
setNamedRange(name, range)voidNames a range.
setRecalculationInterval(recalculationInterval)SpreadsheetSets how often this spreadsheet should recalculate.
setRowHeight(rowPosition, height)SheetSets the row height of the given row in pixels.
setSpreadsheetLocale(locale)voidSets the spreadsheet locale.
setSpreadsheetTheme(theme)SpreadsheetThemeSets a theme on the spreadsheet.
setSpreadsheetTimeZone(timezone)voidSets the time zone for the spreadsheet.
show(userInterface)voidDisplays a custom user interface component in a dialog centered in the user's browser's viewport.
sort(columnPosition)SheetSorts a sheet by column, ascending.
sort(columnPosition, ascending)SheetSorts a sheet by column.
toast(msg)voidShows a popup window in the lower right corner of the spreadsheet with the given message.
toast(msg, title)voidShows a popup window in the lower right corner of the spreadsheet with the given message and title.
toast(msg, title, timeoutSeconds)voidShows a popup window in the lower right corner of the spreadsheet with the given title and message, that stays visible for a certain length of time.
unhideColumn(column)voidUnhides the column in the given range.
unhideRow(row)voidUnhides the row in the given range.
updateMenu(name, subMenus)voidUpdates a menu that was added by addMenu(name, subMenus).
waitForAllDataExecutionsCompletion(timeoutInSeconds)voidWaits until all the current executions in the spreadsheet complete, timing out after the provided number of seconds.

SpreadsheetApp

Properties

PropertyTypeDescription
AutoFillSeriesAutoFillSeriesAn enumeration of the types of series used to calculate auto-filled values.
BandingThemeBandingThemeAn enumeration of the possible banding themes.
BooleanCriteriaBooleanCriteriaAn enumeration of conditional formatting boolean criteria.
BorderStyleBorderStyleAn enumeration of the valid styles for setting borders on a Range.
ColorTypeColorTypeAn enumeration of possible color types.
CopyPasteTypeCopyPasteTypeAn enumeration of the possible paste types.
DataExecutionErrorCodeDataExecutionErrorCodeAn enumeration of the possible data execution error codes.
DataExecutionStateDataExecutionStateAn enumeration of the possible data execution states.
DataSourceParameterTypeDataSourceParameterTypeAn enumeration of the possible data source parameter types.
DataSourceRefreshScopeDataSourceRefreshScopeAn enumeration of possible data source refresh scopes.
DataSourceTypeDataSourceTypeAn enumeration of the possible data source types.
DataValidationCriteriaDataValidationCriteriaAn enumeration representing the data validation criteria that can be set on a range.
DateTimeGroupingRuleTypeDateTimeGroupingRuleTypeAn enumeration of date time grouping rule.
DeveloperMetadataLocationTypeDeveloperMetadataLocationTypeAn enumeration of possible developer metadata location types.
DeveloperMetadataVisibilityDeveloperMetadataVisibilityAn enumeration of the possible developer metadata visibilities.
DimensionDimensionAn enumeration of the possible dimensions of a spreadsheet.
DirectionDirectionA enumeration of the possible directions that one can move within a spreadsheet using the arrow keys.
FrequencyTypeFrequencyTypeAn enumeration of possible frequency types.
GroupControlTogglePositionGroupControlTogglePositionAn enumeration of the positions that the group control toggle can be in.
InterpolationTypeInterpolationTypeAn enumeration of conditional format gradient interpolation types.
PivotTableSummarizeFunctionPivotTableSummarizeFunctionAn enumeration of the functions that may be used to summarize values in a pivot table.
PivotValueDisplayTypePivotValueDisplayTypeAn enumeration of the ways that a pivot value may be displayed.
ProtectionTypeProtectionTypeAn enumeration representing the parts of a spreadsheet that can be protected from edits.
RecalculationIntervalRecalculationIntervalAn enumeration of the possible intervals that can be used in spreadsheet recalculation.
RelativeDateRelativeDateAn enumeration of relative date options for calculating a value to be used in date-based BooleanCriteria.
SheetTypeSheetTypeAn enumeration of the different types of sheets that can exist in a spreadsheet.
SortOrderSortOrderAn enumeration of sort order.
TextDirectionTextDirectionAn enumeration of valid text directions.
TextToColumnsDelimiterTextToColumnsDelimiterAn enumeration of the preset delimiters for split text to columns.
ThemeColorTypeThemeColorTypeAn enumeration of possible theme color types.
ValueTypeValueTypeAn enumeration of value types returned by Range.getValue() and Range.getValues() from the Range class of the Spreadsheet service.
WrapStrategyWrapStrategyAn enumeration of the strategies used for wrapping cells.

Methods

MethodReturn typeBrief description
create(name)SpreadsheetCreates a new spreadsheet with the given name.
create(name, rows, columns)SpreadsheetCreates a new spreadsheet with the given name and the specified number of rows and columns.
enableAllDataSourcesExecution()voidTurns data execution on for all types of data sources.
enableBigQueryExecution()voidTurns data execution on for BigQuery data sources.
enableLookerExecution()voidTurns data execution on for Looker data sources.
flush()voidApplies all pending Spreadsheet changes.
getActive()SpreadsheetReturns the currently active spreadsheet, or null if there is none.
getActiveRange()RangeReturns the selected range in the active sheet, or null if there is no active range.
getActiveRangeList()RangeList|nullReturns the list of active ranges in the active sheet or null if there are no ranges selected.
getActiveSheet()SheetGets the active sheet in a spreadsheet.
getActiveSpreadsheet()SpreadsheetReturns the currently active spreadsheet, or null if there is none.
getCurrentCell()Range|nullReturns the current (highlighted) cell that is selected in one of the active ranges in the active sheet or null if there is no current cell.
getSelection()SelectionReturns the current Selection in the spreadsheet.
getUi()UiReturns an instance of the spreadsheet's user-interface environment that allows the script to add features like menus, dialogs, and sidebars.
newCellImage()CellImageBuilderCreates a builder for a CellImage.
newColor()ColorBuilderCreates a builder for a Color.
newConditionalFormatRule()ConditionalFormatRuleBuilderCreates a builder for a conditional formatting rule.
newDataSourceSpec()DataSourceSpecBuilderCreates a builder for a DataSourceSpec.
newDataValidation()DataValidationBuilderCreates a builder for a data validation rule.
newFilterCriteria()FilterCriteriaBuilderCreates a builder for a FilterCriteria.
newRichTextValue()RichTextValueBuilderCreates a builder for a Rich Text value.
newTextStyle()TextStyleBuilderCreates a builder for a text style.
open(file)SpreadsheetOpens the spreadsheet that corresponds to the given File object.
openById(id)SpreadsheetOpens the spreadsheet with the given ID.
openByUrl(url)SpreadsheetOpens the spreadsheet with the given URL.
setActiveRange(range)RangeSets the specified range as the active range, with the top left cell in the range as the current cell.
setActiveRangeList(rangeList)RangeListSets the specified list of ranges as the active ranges.
setActiveSheet(sheet)SheetSets the active sheet in a spreadsheet.
setActiveSheet(sheet, restoreSelection)SheetSets the active sheet in a spreadsheet, with the option to restore the most recent selection within that sheet.
setActiveSpreadsheet(newActiveSpreadsheet)voidSets the active spreadsheet.
setCurrentCell(cell)RangeSets the specified cell as the current cell.

SpreadsheetTheme

TextDirection

Properties

PropertyTypeDescription
LEFT_TO_RIGHTEnumLeft-to-right text direction.
RIGHT_TO_LEFTEnumRight-to-left text direction.

TextFinder

TextRotation

Methods

MethodReturn typeBrief description
getDegrees()IntegerGets the angle between standard text orientation and the current text orientation.
isVertical()BooleanReturns true if the text is stacked vertically; returns false otherwise.

TextStyle

TextStyleBuilder

TextToColumnsDelimiter

Properties

PropertyTypeDescription
COMMAEnum"," delimiter.
SEMICOLONEnum";" delimiter.
PERIODEnum"." delimiter.
SPACEEnum" " delimiter.

ThemeColor

ThemeColorType

Properties

PropertyTypeDescription
UNSUPPORTEDEnumRepresents a theme color that is not supported.
TEXTEnumRepresents the text color.
BACKGROUNDEnumRepresents the color to use for chart's background.
ACCENT1EnumRepresents the first accent color.
ACCENT2EnumRepresents the second accent color.
ACCENT3EnumRepresents the third accent color.
ACCENT4EnumRepresents the fourth accent color.
ACCENT5EnumRepresents the fifth accent color.
ACCENT6EnumRepresents the sixth accent color.
HYPERLINKEnumRepresents the color to use for hyperlinks.

ValueType

Properties

PropertyTypeDescription
IMAGEEnumThe value type when the cell contains an image.

WrapStrategy

Properties

PropertyTypeDescription
WRAPEnumWrap lines that are longer than the cell width onto a new line.
OVERFLOWEnumOverflow lines into the next cell, so long as that cell is empty.
CLIPEnumClip lines that are longer than the cell width.