Spreadsheet Service

Spreadsheet

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

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.
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).
ConditionalFormatRuleAccess conditional formatting rules.
ConditionalFormatRuleBuilderBuilder for conditional format rules.
ContainerInfoAccess the chart's position within a sheet.
CopyPasteTypeAn enumeration of possible special paste types.
DataValidationAccess data validation rules.
DataValidationBuilderBuilder for data validation rules.
DataValidationCriteriaAn enumeration representing the data validation criteria that can be set on a range.
DimensionAn enumberation 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.
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.
FilterAccess and modify existing filters.
FilterCriteriaAccess filter criteria.
FilterCriteriaBuilderBuilder for FilterCriteria.
GradientConditionAccess gradient (color) conditions in ConditionalFormatRuleApis.
InterpolationTypeAn enumeration representing the interpolation options for calculating a value to be used in a GradientCondition in a ConditionalFormatRule.
NamedRangeCreate, access and modify named ranges 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.
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.
RelativeDateAn enumeration representing the relative date options for calculating a value to be used in date-based BooleanCriteria.
SelectionAccess the current active selection in the active sheet.
SheetAccess and modify spreadsheet sheets.
SpreadsheetAccess and modify Google Sheets files.
SpreadsheetAppAccess and create Google Sheets files.
TextDirectionAn enumerations of text directions.
TextRotationAccess the text rotation settings for a cell.
TextToColumnsDelimiterAn enumeration of the types of preset delimiters that can split a column of text into multiple columns.
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

Methods

MethodReturn typeBrief description
copyTo(range)BandingCopies this banding to another range.
getFirstColumnColor()StringReturns the first column color that is alternating, or null if no color is set.
getFirstRowColor()StringReturns the first row color that is alternating or null if no color is set.
getFooterColumnColor()StringReturns the color of the last column, or null if no color is set.
getFooterRowColor()StringReturns the color of the last row, or null if no color is set.
getHeaderColumnColor()StringReturns the color of the header column, or null if no color is set.
getHeaderRowColor()StringReturns the color of the header row or null if no color is set.
getRange()RangeReturns the range for this banding.
getSecondColumnColor()StringReturns the second column color that is alternating, or null if no color is set.
getSecondRowColor()StringReturns the second row color that is alternating or null if no color is set.
remove()voidRemoves this banding.
setFirstColumnColor(color)BandingSets the first column color that is alternating.
setFirstRowColor(color)BandingSets the first row color that is alternating.
setFooterColumnColor(color)BandingSets the color of the last column.
setFooterRowColor(color)BandingSets the color of the last row.
setHeaderColumnColor(color)BandingSets the color of the header column.
setHeaderRowColor(color)BandingSets the color of the header row.
setRange(range)BandingSets the range for this banding.
setSecondColumnColor(color)BandingSets the second column color that is alternating.
setSecondRowColor(color)BandingSets the second row color that is alternating.

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.

BooleanCondition

Methods

MethodReturn typeBrief description
getBackground()StringGets the background color string for this boolean condition.
getBold()BooleanReturns 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.
getFontColor()StringGets the font color string for this boolean condition.
getItalic()BooleanReturns true if this boolean condition italicises the text and returns false if this boolean condition removes italics from the text.
getStrikethrough()BooleanReturns true if this boolean condition strikes through the text and returns false if this boolean condition removes strikethrough from the text.
getUnderline()BooleanReturns 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_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_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.

ConditionalFormatRule

Methods

MethodReturn typeBrief description
copy()ConditionalFormatRuleBuilderReturns a rule builder preset with this rule's settings.
getBooleanCondition()BooleanConditionRetrieves the rule's BooleanCondition information if this rule uses boolean condition criteria.
getGradientCondition()GradientConditionRetrieves 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.

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()BooleanConditionRetrieves the rule's BooleanCondition information if this rule uses boolean condition criteria.
getGradientCondition()GradientConditionRetrieves 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.
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.
setGradientMaxpoint(color)ConditionalFormatRuleBuilderClears the conditional format rule's gradient maxpoint value, and instead uses the maximum value in the rule's ranges.
setGradientMaxpointWithValue(color, type, value)ConditionalFormatRuleBuilderSets the conditional format rule's gradient maxpoint 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.
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 and data validation 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.

DataValidation

Methods

MethodReturn typeBrief description
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.

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.
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.

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.

EmbeddedAreaChartBuilder

Methods

MethodReturn typeBrief description
addRange(range)EmbeddedChartBuilderAdds a range to the chart represented by this builder.
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.
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 represented by this builder.
reverseCategories()EmbeddedAreaChartBuilderReverses the drawing of series in the domain axis.
setBackgroundColor(cssValue)EmbeddedAreaChartBuilderSets the background color for the chart.
setChartType(type)EmbeddedChartBuilderChanges the type of chart.
setColors(cssValues)EmbeddedAreaChartBuilderSets the colors for the lines in the chart.
setHiddenDimensionStrategy(strategy)EmbeddedChartBuilderSets the strategy to use for hidden rows and columns.
setLegendPosition(position)EmbeddedAreaChartBuilderSets the position of the legend with respect to the chart.
setLegendTextStyle(textStyle)EmbeddedAreaChartBuilderSets the text style of the chart legend.
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.
setPointStyle(style)EmbeddedAreaChartBuilderSets the style for points in the line.
setPosition(anchorRowPos, anchorColPos, offsetX, offsetY)EmbeddedChartBuilderSets the position, changing where the chart appears on the sheet.
setRange(start, end)EmbeddedAreaChartBuilderSets the range for the chart.
setStacked()EmbeddedAreaChartBuilderUses stacked lines, meaning that line and bar values are stacked (accumulated).
setTitle(chartTitle)EmbeddedAreaChartBuilderSets the title of the chart.
setTitleTextStyle(textStyle)EmbeddedAreaChartBuilderSets the text style of the chart title.
setTransposeRowsAndColumns(transpose)EmbeddedChartBuilderSets whether the chart's rows and columns are transposed.
setXAxisTextStyle(textStyle)EmbeddedAreaChartBuilderSets the horizontal axis text style.
setXAxisTitle(title)EmbeddedAreaChartBuilderAdds a title to the horizontal axis.
setXAxisTitleTextStyle(textStyle)EmbeddedAreaChartBuilderSets the horizontal axis title text style.
setYAxisTextStyle(textStyle)EmbeddedAreaChartBuilderSets the vertical axis text style.
setYAxisTitle(title)EmbeddedAreaChartBuilderAdds a title to the vertical axis.
setYAxisTitleTextStyle(textStyle)EmbeddedAreaChartBuilderSets the vertical axis title text style.
useLogScale()EmbeddedAreaChartBuilderMakes the range axis into a logarithmic scale (requires all values to be positive).

EmbeddedBarChartBuilder

Methods

MethodReturn typeBrief description
addRange(range)EmbeddedChartBuilderAdds a range to the chart represented by this builder.
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.
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 represented by this builder.
reverseCategories()EmbeddedBarChartBuilderReverses the drawing of series in the domain axis.
reverseDirection()EmbeddedBarChartBuilderReverses the direction in which the bars grow along the horizontal axis.
setBackgroundColor(cssValue)EmbeddedBarChartBuilderSets the background color for the chart.
setChartType(type)EmbeddedChartBuilderChanges the type of chart.
setColors(cssValues)EmbeddedBarChartBuilderSets the colors for the lines in the chart.
setHiddenDimensionStrategy(strategy)EmbeddedChartBuilderSets the strategy to use for hidden rows and columns.
setLegendPosition(position)EmbeddedBarChartBuilderSets the position of the legend with respect to the chart.
setLegendTextStyle(textStyle)EmbeddedBarChartBuilderSets the text style of the chart legend.
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.
setRange(start, end)EmbeddedBarChartBuilderSets the range for the chart.
setStacked()EmbeddedBarChartBuilderUses stacked lines, meaning that line and bar values are stacked (accumulated).
setTitle(chartTitle)EmbeddedBarChartBuilderSets the title of the chart.
setTitleTextStyle(textStyle)EmbeddedBarChartBuilderSets the text style of the chart title.
setTransposeRowsAndColumns(transpose)EmbeddedChartBuilderSets whether the chart's rows and columns are transposed.
setXAxisTextStyle(textStyle)EmbeddedBarChartBuilderSets the horizontal axis text style.
setXAxisTitle(title)EmbeddedBarChartBuilderAdds a title to the horizontal axis.
setXAxisTitleTextStyle(textStyle)EmbeddedBarChartBuilderSets the horizontal axis title text style.
setYAxisTextStyle(textStyle)EmbeddedBarChartBuilderSets the vertical axis text style.
setYAxisTitle(title)EmbeddedBarChartBuilderAdds a title to the vertical axis.
setYAxisTitleTextStyle(textStyle)EmbeddedBarChartBuilderSets the vertical axis title text style.
useLogScale()EmbeddedBarChartBuilderMakes the range axis into a logarithmic scale (requires all values to be positive).

EmbeddedChart

Methods

MethodReturn typeBrief description
getAs(contentType)BlobReturn the data inside this object as a blob converted to the specified content type.
getBlob()BlobReturn the data inside this object as a blob.
getContainerInfo()ContainerInfoReturns information about where the chart is positioned within a sheet.
getHiddenDimensionStrategy()ChartHiddenDimensionStrategyReturns the strategy to use for handling hidden rows and columns.
getId()StringReturns the id that has been assigned to this object.
getMergeStrategy()ChartMergeStrategyReturns the merge strategy used when more than one range exists.
getNumHeaders()IntegerReturns the number of rows or columns the range that are treated as headers.
getOptions()ChartOptionsReturns the options for this chart, such as height, colors, axes, etc.
getRanges()Range[]Returns the ranges that this chart uses as a data source.
getTransposeRowsAndColumns()BooleanIf true, the rows and columns used to populate the chart are switched.
getType()StringGets the type of this object.
modify()EmbeddedChartBuilderReturns an EmbeddedChartBuilder that can be used to modify this chart.
setId(id)ChartSets the id of this EmbeddedChart to be used with UiApp.

EmbeddedChartBuilder

Methods

MethodReturn typeBrief description
addRange(range)EmbeddedChartBuilderAdds a range to the chart represented by this builder.
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.
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 represented by this builder.
setChartType(type)EmbeddedChartBuilderChanges the type of chart.
setHiddenDimensionStrategy(strategy)EmbeddedChartBuilderSets the strategy to use for hidden rows and columns.
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.

EmbeddedColumnChartBuilder

Methods

MethodReturn typeBrief description
addRange(range)EmbeddedChartBuilderAdds a range to the chart represented by this builder.
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.
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 represented by this builder.
reverseCategories()EmbeddedColumnChartBuilderReverses the drawing of series in the domain axis.
setBackgroundColor(cssValue)EmbeddedColumnChartBuilderSets the background color for the chart.
setChartType(type)EmbeddedChartBuilderChanges the type of chart.
setColors(cssValues)EmbeddedColumnChartBuilderSets the colors for the lines in the chart.
setHiddenDimensionStrategy(strategy)EmbeddedChartBuilderSets the strategy to use for hidden rows and columns.
setLegendPosition(position)EmbeddedColumnChartBuilderSets the position of the legend with respect to the chart.
setLegendTextStyle(textStyle)EmbeddedColumnChartBuilderSets the text style of the chart legend.
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.
setRange(start, end)EmbeddedColumnChartBuilderSets the range for the chart.
setStacked()EmbeddedColumnChartBuilderUses stacked lines, meaning that line and bar values are stacked (accumulated).
setTitle(chartTitle)EmbeddedColumnChartBuilderSets the title of the chart.
setTitleTextStyle(textStyle)EmbeddedColumnChartBuilderSets the text style of the chart title.
setTransposeRowsAndColumns(transpose)EmbeddedChartBuilderSets whether the chart's rows and columns are transposed.
setXAxisTextStyle(textStyle)EmbeddedColumnChartBuilderSets the horizontal axis text style.
setXAxisTitle(title)EmbeddedColumnChartBuilderAdds a title to the horizontal axis.
setXAxisTitleTextStyle(textStyle)EmbeddedColumnChartBuilderSets the horizontal axis title text style.
setYAxisTextStyle(textStyle)EmbeddedColumnChartBuilderSets the vertical axis text style.
setYAxisTitle(title)EmbeddedColumnChartBuilderAdds a title to the vertical axis.
setYAxisTitleTextStyle(textStyle)EmbeddedColumnChartBuilderSets the vertical axis title text style.
useLogScale()EmbeddedColumnChartBuilderMakes the range axis into a logarithmic scale (requires all values to be positive).

EmbeddedComboChartBuilder

Methods

MethodReturn typeBrief description
addRange(range)EmbeddedChartBuilderAdds a range to the chart represented by this builder.
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.
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 represented by this builder.
reverseCategories()EmbeddedComboChartBuilderReverses the drawing of series in the domain axis.
setBackgroundColor(cssValue)EmbeddedComboChartBuilderSets the background color for the chart.
setChartType(type)EmbeddedChartBuilderChanges the type of chart.
setColors(cssValues)EmbeddedComboChartBuilderSets the colors for the lines in the chart.
setHiddenDimensionStrategy(strategy)EmbeddedChartBuilderSets the strategy to use for hidden rows and columns.
setLegendPosition(position)EmbeddedComboChartBuilderSets the position of the legend with respect to the chart.
setLegendTextStyle(textStyle)EmbeddedComboChartBuilderSets the text style of the chart legend.
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.
setRange(start, end)EmbeddedComboChartBuilderSets the range for the chart.
setStacked()EmbeddedComboChartBuilderUses stacked lines, meaning that line and bar values are stacked (accumulated).
setTitle(chartTitle)EmbeddedComboChartBuilderSets the title of the chart.
setTitleTextStyle(textStyle)EmbeddedComboChartBuilderSets the text style of the chart title.
setTransposeRowsAndColumns(transpose)EmbeddedChartBuilderSets whether the chart's rows and columns are transposed.
setXAxisTextStyle(textStyle)EmbeddedComboChartBuilderSets the horizontal axis text style.
setXAxisTitle(title)EmbeddedComboChartBuilderAdds a title to the horizontal axis.
setXAxisTitleTextStyle(textStyle)EmbeddedComboChartBuilderSets the horizontal axis title text style.
setYAxisTextStyle(textStyle)EmbeddedComboChartBuilderSets the vertical axis text style.
setYAxisTitle(title)EmbeddedComboChartBuilderAdds a title to the vertical axis.
setYAxisTitleTextStyle(textStyle)EmbeddedComboChartBuilderSets the vertical axis title text style.
useLogScale()EmbeddedComboChartBuilderMakes the range axis into a logarithmic scale (requires all values to be positive).

EmbeddedHistogramChartBuilder

Methods

MethodReturn typeBrief description
addRange(range)EmbeddedChartBuilderAdds a range to the chart represented by this builder.
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.
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 represented by this builder.
reverseCategories()EmbeddedHistogramChartBuilderReverses the drawing of series in the domain axis.
setBackgroundColor(cssValue)EmbeddedHistogramChartBuilderSets the background color for the chart.
setChartType(type)EmbeddedChartBuilderChanges the type of chart.
setColors(cssValues)EmbeddedHistogramChartBuilderSets the colors for the lines in the chart.
setHiddenDimensionStrategy(strategy)EmbeddedChartBuilderSets the strategy to use for hidden rows and columns.
setLegendPosition(position)EmbeddedHistogramChartBuilderSets the position of the legend with respect to the chart.
setLegendTextStyle(textStyle)EmbeddedHistogramChartBuilderSets the text style of the chart legend.
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.
setRange(start, end)EmbeddedHistogramChartBuilderSets the range for the chart.
setStacked()EmbeddedHistogramChartBuilderUses stacked lines, meaning that line and bar values are stacked (accumulated).
setTitle(chartTitle)EmbeddedHistogramChartBuilderSets the title of the chart.
setTitleTextStyle(textStyle)EmbeddedHistogramChartBuilderSets the text style of the chart title.
setTransposeRowsAndColumns(transpose)EmbeddedChartBuilderSets whether the chart's rows and columns are transposed.
setXAxisTextStyle(textStyle)EmbeddedHistogramChartBuilderSets the horizontal axis text style.
setXAxisTitle(title)EmbeddedHistogramChartBuilderAdds a title to the horizontal axis.
setXAxisTitleTextStyle(textStyle)EmbeddedHistogramChartBuilderSets the horizontal axis title text style.
setYAxisTextStyle(textStyle)EmbeddedHistogramChartBuilderSets the vertical axis text style.
setYAxisTitle(title)EmbeddedHistogramChartBuilderAdds a title to the vertical axis.
setYAxisTitleTextStyle(textStyle)EmbeddedHistogramChartBuilderSets the vertical axis title text style.
useLogScale()EmbeddedHistogramChartBuilderMakes the range axis into a logarithmic scale (requires all values to be positive).

EmbeddedLineChartBuilder

Methods

MethodReturn typeBrief description
addRange(range)EmbeddedChartBuilderAdds a range to the chart represented by this builder.
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.
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 represented by this builder.
reverseCategories()EmbeddedLineChartBuilderReverses the drawing of series in the domain axis.
setBackgroundColor(cssValue)EmbeddedLineChartBuilderSets the background color for the chart.
setChartType(type)EmbeddedChartBuilderChanges the type of chart.
setColors(cssValues)EmbeddedLineChartBuilderSets the colors for the lines in the chart.
setCurveStyle(style)EmbeddedLineChartBuilderSets the style to use for curves in the chart.
setHiddenDimensionStrategy(strategy)EmbeddedChartBuilderSets the strategy to use for hidden rows and columns.
setLegendPosition(position)EmbeddedLineChartBuilderSets the position of the legend with respect to the chart.
setLegendTextStyle(textStyle)EmbeddedLineChartBuilderSets the text style of the chart legend.
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.
setPointStyle(style)EmbeddedLineChartBuilderSets the style for points in the line.
setPosition(anchorRowPos, anchorColPos, offsetX, offsetY)EmbeddedChartBuilderSets the position, changing where the chart appears on the sheet.
setRange(start, end)EmbeddedLineChartBuilderSets the range for the chart.
setTitle(chartTitle)EmbeddedLineChartBuilderSets the title of the chart.
setTitleTextStyle(textStyle)EmbeddedLineChartBuilderSets the text style of the chart title.
setTransposeRowsAndColumns(transpose)EmbeddedChartBuilderSets whether the chart's rows and columns are transposed.
setXAxisTextStyle(textStyle)EmbeddedLineChartBuilderSets the horizontal axis text style.
setXAxisTitle(title)EmbeddedLineChartBuilderAdds a title to the horizontal axis.
setXAxisTitleTextStyle(textStyle)EmbeddedLineChartBuilderSets the horizontal axis title text style.
setYAxisTextStyle(textStyle)EmbeddedLineChartBuilderSets the vertical axis text style.
setYAxisTitle(title)EmbeddedLineChartBuilderAdds a title to the vertical axis.
setYAxisTitleTextStyle(textStyle)EmbeddedLineChartBuilderSets the vertical axis title text style.
useLogScale()EmbeddedLineChartBuilderMakes the range axis into a logarithmic scale (requires all values to be positive).

EmbeddedPieChartBuilder

Methods

MethodReturn typeBrief description
addRange(range)EmbeddedChartBuilderAdds a range to the chart represented by this builder.
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.
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 represented by this builder.
reverseCategories()EmbeddedPieChartBuilderReverses the drawing of series in the domain axis.
set3D()EmbeddedPieChartBuilderSets the chart to be three-dimensional.
setBackgroundColor(cssValue)EmbeddedPieChartBuilderSets the background color for the chart.
setChartType(type)EmbeddedChartBuilderChanges the type of chart.
setColors(cssValues)EmbeddedPieChartBuilderSets the colors for the lines in the chart.
setHiddenDimensionStrategy(strategy)EmbeddedChartBuilderSets the strategy to use for hidden rows and columns.
setLegendPosition(position)EmbeddedPieChartBuilderSets the position of the legend with respect to the chart.
setLegendTextStyle(textStyle)EmbeddedPieChartBuilderSets the text style of the chart legend.
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.
setTitle(chartTitle)EmbeddedPieChartBuilderSets the title of the chart.
setTitleTextStyle(textStyle)EmbeddedPieChartBuilderSets the text style of the chart title.
setTransposeRowsAndColumns(transpose)EmbeddedChartBuilderSets whether the chart's rows and columns are transposed.

EmbeddedScatterChartBuilder

Methods

MethodReturn typeBrief description
addRange(range)EmbeddedChartBuilderAdds a range to the chart represented by this builder.
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.
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 represented by this builder.
setBackgroundColor(cssValue)EmbeddedScatterChartBuilderSets the background color for the chart.
setChartType(type)EmbeddedChartBuilderChanges the type of chart.
setColors(cssValues)EmbeddedScatterChartBuilderSets the colors for the lines in the chart.
setHiddenDimensionStrategy(strategy)EmbeddedChartBuilderSets the strategy to use for hidden rows and columns.
setLegendPosition(position)EmbeddedScatterChartBuilderSets the position of the legend with respect to the chart.
setLegendTextStyle(textStyle)EmbeddedScatterChartBuilderSets the text style of the chart legend.
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.
setPointStyle(style)EmbeddedScatterChartBuilderSets the style for points in the line.
setPosition(anchorRowPos, anchorColPos, offsetX, offsetY)EmbeddedChartBuilderSets the position, changing where the chart appears on the sheet.
setTitle(chartTitle)EmbeddedScatterChartBuilderSets the title of the chart.
setTitleTextStyle(textStyle)EmbeddedScatterChartBuilderSets the text style of the chart title.
setTransposeRowsAndColumns(transpose)EmbeddedChartBuilderSets whether the chart's rows and columns are transposed.
setXAxisLogScale()EmbeddedScatterChartBuilderMakes the horizontal axis into a logarithmic scale (requires all values to be positive).
setXAxisRange(start, end)EmbeddedScatterChartBuilderSets the range for the horizontal axis of the chart.
setXAxisTextStyle(textStyle)EmbeddedScatterChartBuilderSets the horizontal axis text style.
setXAxisTitle(title)EmbeddedScatterChartBuilderAdds a title to the horizontal axis.
setXAxisTitleTextStyle(textStyle)EmbeddedScatterChartBuilderSets the horizontal axis title text style.
setYAxisLogScale()EmbeddedScatterChartBuilderMakes the vertical axis into a logarithmic scale (requires all values to be positive).
setYAxisRange(start, end)EmbeddedScatterChartBuilderSets the range for the vertical axis of the chart.
setYAxisTextStyle(textStyle)EmbeddedScatterChartBuilderSets the vertical axis text style.
setYAxisTitle(title)EmbeddedScatterChartBuilderAdds a title to the vertical axis.
setYAxisTitleTextStyle(textStyle)EmbeddedScatterChartBuilderSets the vertical axis title text style.

EmbeddedTableChartBuilder

Methods

MethodReturn typeBrief description
addRange(range)EmbeddedChartBuilderAdds a range to the chart represented by this builder.
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.
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 represented by this builder.
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 will be assigned to odd and even rows of a table chart.

Filter

Methods

MethodReturn typeBrief description
getColumnFilterCriteria(columnPosition)FilterCriteriaGets the filter criteria on the specified column, or null if no filter criteria is set.
getRange()RangeGets the range this filter is applied to.
remove()voidRemoves this filter.
removeColumnFilterCriteria(columnPosition)FilterRemoves the filter criteria from the specified column.
setColumnFilterCriteria(columnPosition, filterCriteria)FilterSets the filter criteria on the specified column.
sort(columnPosition, ascending)FilterSorts the filtered range by the specified column, excluding the first row (the header row) in the range this filter is applied to.

FilterCriteria

Methods

MethodReturn typeBrief description
copy()FilterCriteriaBuilderCreates a builder for a filter criteria based on this filter criteria's settings.
getCriteriaType()BooleanCriteriaReturns the boolean criteria type as defined in the BooleanCriteria enum.
getCriteriaValues()Object[]Returns an array of arguments for the boolean criteria.
getHiddenValues()String[]Returns the values to hide.
getVisibleValues()String[]Returns the values to show.

FilterCriteriaBuilder

Methods

MethodReturn typeBrief description
build()FilterCriteriaConstructs a filter criteria from the settings supplied to the builder.
copy()FilterCriteriaBuilderCreates a builder for a filter criteria based on this filter criteria's settings.
getCriteriaType()BooleanCriteriaReturns the boolean criteria type as defined in the BooleanCriteria enum.
getCriteriaValues()Object[]Returns an array of arguments for the boolean criteria.
getHiddenValues()String[]Returns the values to hide.
getVisibleValues()String[]Returns the values to show.
setHiddenValues(values)FilterCriteriaBuilderSets the values to hide.
setVisibleValues(values)FilterCriteriaBuilderSets the values to show.
whenCellEmpty()FilterCriteriaBuilderSets the filter criteria to show cells where the cell is empty.
whenCellNotEmpty()FilterCriteriaBuilderSets the filter criteria to show cells where the cell is not empty.
whenDateAfter(date)FilterCriteriaBuilderSets the filter criteria to show cells where the cell date is after the specified value.
whenDateAfter(date)FilterCriteriaBuilderSets the filter criteria to show cells where the cell date is after the specified relative date.
whenDateBefore(date)FilterCriteriaBuilderSets the filter criteria to show cells where the cell date is before the specified date.
whenDateBefore(date)FilterCriteriaBuilderSets the filter criteria to show cells where a cell date is before the specified relative date.
whenDateEqualTo(date)FilterCriteriaBuilderSets the filter criteria to show cells where a cell date is equal to the specified date.
whenDateEqualTo(date)FilterCriteriaBuilderSets the filter criteria to show cells where a cell date is equal to the specified relative date.
whenFormulaSatisfied(formula)FilterCriteriaBuilderSets the filter criteria to show cells where the specified formula (such as "=B:Btrue.
whenNumberBetween(start, end)FilterCriteriaBuilderSets the filter criteria to show cells where the cell number is falls between, or is either of, two specified numbers.
whenNumberEqualTo(number)FilterCriteriaBuilderSets the filter criteria to show cells where the cell number is equal to the specified value.
whenNumberGreaterThan(number)FilterCriteriaBuilderSets the filter criteria to show cells where the cell number is greater than the specified value.
whenNumberGreaterThanOrEqualTo(number)FilterCriteriaBuilderSets the filter criteria to show cells where the cell number is greater than or equal to the specified value.
whenNumberLessThan(number)FilterCriteriaBuilderSets the conditional conditional format rule to show cells where the cell number is less than the specified value.
whenNumberLessThanOrEqualTo(number)FilterCriteriaBuilderSets the filter criteria to show cells where the cell number is less than or equal to the specified value.
whenNumberNotBetween(start, end)FilterCriteriaBuilderSets the filter criteria to show cells where the cell number does not fall between, and is neither of, two specified numbers.
whenNumberNotEqualTo(number)FilterCriteriaBuilderSets the filter criteria to show cells where the cell number is not equal to the specified value.
whenTextContains(text)FilterCriteriaBuilderSets the filter criteria to show cells where the cell text contains the specified text.
whenTextDoesNotContain(text)FilterCriteriaBuilderSets the filter criteria to show cells where the cell text does not contain the specified text.
whenTextEndsWith(text)FilterCriteriaBuilderSets the filter criteria to show cells where the cell text ends with the specified text.
whenTextEqualTo(text)FilterCriteriaBuilderSets the filter criteria to show cells where the cell text is equal to the specified text.
whenTextStartsWith(text)FilterCriteriaBuilderSets the filter criteria to show cells where the cell text starts with the specified text.
withCriteria(criteria, args)FilterCriteriaBuilderSets the boolean criteria to criteria defined by BooleanCriteria values, typically taken from the criteria and arguments of an existing criteria.

GradientCondition

Methods

MethodReturn typeBrief description
getMaxColor()StringGets the color set for the maximum value of this gradient condition.
getMaxType()InterpolationTypeGets the interpolation type for the maximum value of this gradient condition.
getMaxValue()StringGets the max value of this gradient condition.
getMidColor()StringGets the color set for the mid-point value of this gradient condition.
getMidType()InterpolationTypeGets the interpolation type for the mid-point value of this gradient condition.
getMidValue()StringGets the mid-point value of this gradient condition.
getMinColor()StringGets the color set for the minimum value of this gradient condition.
getMinType()InterpolationTypeGets the interpolation type for the minimum value of this gradient condition.
getMinValue()StringGets the minimum value of this gradient condition.

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.

NamedRange

Methods

MethodReturn typeBrief description
getName()StringGets the name of this named range.
getRange()RangeGets the range referenced by this named range.
remove()voidDeletes this named range.
setName(name)NamedRangeSets/updates the name of the named range.
setRange(range)NamedRangeSets/updates the range for this named range.

PageProtection

PivotFilter

Methods

MethodReturn typeBrief description
getFilterCriteria()FilterCriteriaReturns the filter criteria for this pivot filter.
getPivotTable()PivotTableReturns the PivotTable that this filter belongs to.
getSourceDataColumn()IntegerReturns the number of the source data column this filter operates on.
remove()voidRemoves this pivot filter from the pivot table.
setFilterCriteria(filterCriteria)PivotFilterSets the filter criteria for this pivot filter.

PivotGroup

Methods

MethodReturn typeBrief description
addManualGroupingRule(groupName, groupMembers)PivotGroupAdds a manual grouping rule for this pivot group.
areLabelsRepeated()BooleanReturns whether labels are displayed as repeated.
clearGroupingRule()PivotGroupRemoves any grouping rules from this pivot group.
clearSort()PivotGroupRemoves any sorting applied to this group.
getDimension()DimensionReturns whether this is a row or column group.
getIndex()IntegerReturns the index of this pivot group in the current group order.
getPivotTable()PivotTableReturns the PivotTable which this grouping belongs to.
getSourceDataColumn()IntegerReturns the number of the source data column this group summarizes.
hideRepeatedLabels()PivotGroupHides repeated labels for this grouping.
isSortAscending()BooleanReturns true if the sort is ascending, returns false if the sort order is descending.
moveToIndex(index)PivotGroupMoves this group to the specified position in the current list of row or column groups.
remove()voidRemoves this pivot group from the table.
removeManualGroupingRule(groupName)PivotGroupRemoves the manual grouping rule with the specified groupName.
resetDisplayName()PivotGroupResets the display name of this group in the pivot table to its default value.
setDisplayName(name)PivotGroupSets the display name of this group in the pivot table.
setHistogramGroupingRule(minValue, maxValue, intervalSize)PivotGroupSets a histogram grouping rule for this pivot group.
showRepeatedLabels()PivotGroupWhen there is more than one row or column grouping, this method displays this grouping's label for each entry of the subsequent grouping.
showTotals(showTotals)PivotGroupSets whether to show total values for this pivot group in the table.
sortAscending()PivotGroupSets the sort order to be ascending.
sortBy(value, oppositeGroupValues)PivotGroupSorts this group by the specified PivotValue for the values from the oppositeGroupValues.
sortDescending()PivotGroupSets the sort order to be descending.
totalsAreShown()BooleanReturns whether total values are currently shown for this pivot group.

PivotTable

Methods

MethodReturn typeBrief description
addCalculatedPivotValue(name, formula)PivotValueCreates a new pivot value in the pivot table calculated from the specified formula with the specified name.
addColumnGroup(sourceDataColumn)PivotGroupDefines a new pivot column grouping in the pivot table.
addFilter(sourceDataColumn, filterCriteria)PivotFilterCreates a new pivot filter for the pivot table.
addPivotValue(sourceDataColumn, summarizeFunction)PivotValueDefines a new pivot value in the pivot table with the specified summarizeFunction.
addRowGroup(sourceDataColumn)PivotGroupDefines a new pivot row grouping in the pivot table.
getAnchorCell()RangeReturns the Range representing the cell where this pivot table is anchored.
getColumnGroups()PivotGroup[]Returns an ordered list of the column groups in this pivot table.
getFilters()PivotFilter[]Returns an ordered list of the filters in this pivot table.
getPivotValues()PivotValue[]Returns an ordered list of the pivot values in this pivot table.
getRowGroups()PivotGroup[]Returns an ordered list of the row groups in this pivot table.
getValuesDisplayOrientation()DimensionReturns whether values are displayed as rows or columns.
remove()voidDeletes this pivot table.
setValuesDisplayOrientation(dimension)PivotTableSets the layout of this pivot table to display values as columns or rows.

PivotTableSummarizeFunction

Properties

PropertyTypeDescription
CUSTOMEnumA custom fuction, this value is only valid for calcuated 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

Methods

MethodReturn typeBrief description
getDisplayType()PivotValueDisplayTypeReturns the display type describing how this pivot value is currently displayed in the table.
getFormula()StringReturns the formula used to calculate this value.
getPivotTable()PivotTableReturns the PivotTable which this value belongs to.
getSummarizedBy()PivotTableSummarizeFunctionReturns this group’s summarization function.
setDisplayName(name)PivotValueSets the display name for this value in the pivot table.
setFormula(formula)PivotValueSets the formula used to calculate this value.
showAs(displayType)PivotValueDisplays this value in the pivot table as a function of another value.
summarizeBy(summarizeFunction)PivotValueSets the summarization function.

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

Methods

MethodReturn typeBrief description
addEditor(emailAddress)ProtectionAdds the given user to the list of editors for the protected sheet or range.
addEditor(user)ProtectionAdds the given user to the list of editors for the protected sheet or range.
addEditors(emailAddresses)ProtectionAdds the given array of users to the list of editors for the protected sheet or range.
canDomainEdit()BooleanDetermines whether all users in the domain that owns the spreadsheet have permission to edit the protected range or sheet.
canEdit()BooleanDetermines whether the user has permission to edit the protected range or sheet.
getDescription()StringGets the description of the protected range or sheet.
getEditors()User[]Gets the list of editors for the protected range or sheet.
getProtectionType()ProtectionTypeGets the type of the protected area, either RANGE or SHEET.
getRange()RangeGets the range that is being protected.
getRangeName()StringGets the name of the protected range if it is associated with a named range.
getUnprotectedRanges()Range[]Gets an array of unprotected ranges within a protected sheet.
isWarningOnly()BooleanDetermines if the protected area is using "warning based" protection.
remove()voidUnprotects the range or sheet.
removeEditor(emailAddress)ProtectionRemoves the given user from the list of editors for the protected sheet or range.
removeEditor(user)ProtectionRemoves the given user from the list of editors for the protected sheet or range.
removeEditors(emailAddresses)ProtectionRemoves the given array of users from the list of editors for the protected sheet or range.
setDescription(description)ProtectionSets the description of the protected range or sheet.
setDomainEdit(editable)ProtectionSets whether all users in the domain that owns the spreadsheet have permission to edit the protected range or sheet.
setNamedRange(namedRange)ProtectionAssociates the protected range with an existing named range.
setRange(range)ProtectionAdjusts the range that is being protected.
setRangeName(rangeName)ProtectionAssociates the protected range with an existing named range.
setUnprotectedRanges(ranges)ProtectionUnprotects the given array of ranges within a protected sheet.
setWarningOnly(warningOnly)ProtectionSets whether or not this protected range is using "warning based" 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.
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.
clear()RangeClears the range of contents, formats, and data validation rules.
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.
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.
createFilter()FilterCreates a filter applied to the range.
createPivotTable(sourceData)PivotTableCreates an empty pivot table from the specified sourceData anchored at the first cell in this range.
deleteCells(shiftDimension)voidDeletes this range of cells.
getA1Notation()StringReturns a string description of the range, in A1 notation.
getBackground()StringReturns the background color of the top-left cell in the range (i.e., '#ffffff').
getBackgrounds()String[][]Returns the background colors of the cells in the range (i.e., '#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.
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.
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()FilterReturns the filter in the sheet this range belongs to, or null if there is no filter on the sheet.
getFontColor()StringReturns the font color of the cell in the top-left corner of the range, in CSS notation (such as '#ffffff' or 'white').
getFontColors()String[][]Returns the font colors of the cells in the range in CSS notation (such as '#ffffff' or 'white').
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.
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.
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 the wrapping policy of the cell in the top-left corner of the range.
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 the wrapping policy of the cells in the range.
insertCells(shiftDimension)RangeInserts empty cells into this range.
isBlank()BooleanReturns true if the range is totally blank.
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.
setBackground(color)RangeSets the background color of all cells in the range in CSS notation (such as '#ffffff' or 'white').
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').
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).
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.
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).
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.

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.
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.
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.

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.

Selection

Methods

MethodReturn typeBrief description
getActiveRange()RangeReturns the selected range in the active sheet, or null if there is no active range.
getActiveRangeList()RangeListReturns the list of active ranges in the active sheet or null if there are no active ranges.
getActiveSheet()SheetReturns the active sheet in the spreadsheet.
getCurrentCell()RangeReturns the current (highlighted) cell that is selected in one of the active ranges or null if there is no current cell.
getNextDataRange(direction)RangeStarting from the current cell and active range and moving in the given direction, returns an adjusted range where the appropriate edge of the range has been shifted to cover the next data cell while still covering the current cell.

Sheet

Methods

MethodReturn typeBrief description
activate()SheetActivates this sheet.
appendRow(rowContents)SheetAppends a row to the spreadsheet.
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.
copyTo(spreadsheet)SheetCopies the sheet to a given spreadsheet, which can be the same spreadsheet as the source.
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.
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()RangeListReturns 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.
getColumnWidth(columnPosition)IntegerGets the width in pixels of the given column.
getConditionalFormatRules()ConditionalFormatRule[]Get all conditional format rules in this sheet.
getCurrentCell()RangeReturns 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.
getFilter()FilterReturns the filter in this sheet, or null if there is no filter.
getFormUrl()StringReturns 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.
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.
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.
getTabColor()StringGets the sheet tab color, or null if the sheet tab has no color.
hasHiddenGridlines()BooleanReturns true if the sheet's gridlines are hidden; otherwise returns false.
hideColumn(column)voidHides the columns in the given range.
hideColumns(columnIndex)voidHides the 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 number of columns after the given column position.
insertColumnsBefore(beforePosition, howMany)SheetInserts a number of columns before the given column position.
insertImage(blob, column, row)voidInserts a Blob as an image in the document at a given row and column.
insertImage(blob, column, row, offsetX, offsetY)voidInserts a Blob as an image in the document at a given row and column, with a pixel offset.
insertImage(url, column, row)voidInserts an image in the document at a given row and column.
insertImage(url, column, row, offsetX, offsetY)voidInserts 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.
isRightToLeft()BooleanReturns true if this sheet layout is right-to-left.
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.
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.
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.
setTabColor(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.

Spreadsheet

Methods

MethodReturn typeBrief description
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 spreadsheet.
autoResizeColumn(columnPosition)SheetSets the width of the given column to fit its contents.
copy(name)SpreadsheetCopies the spreadsheet and returns the new one.
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()RangeListReturns 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()RangeReturns 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.
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.
getLastColumn()IntegerReturns the position of the last column that has content.
getLastRow()IntegerReturns the position of the last row that has content.
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.
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.
getRowHeight(rowPosition)IntegerGets the height in pixels of the given row.
getSelection()SelectionReturns the current Selection in the spreadsheet.
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.
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 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 number of columns after the given column position.
insertColumnsBefore(beforePosition, howMany)SheetInserts a number of columns before the given column position.
insertImage(blob, column, row)voidInserts a Blob as an image in the document at a given row and column.
insertImage(blob, column, row, offsetX, offsetY)voidInserts a Blob as an image in the document at a given row and column, with a pixel offset.
insertImage(url, column, row)voidInserts an image in the document at a given row and column.
insertImage(url, column, row, offsetX, offsetY)voidInserts 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.
moveActiveSheet(pos)voidMoves the active sheet to the given position in the list of sheets.
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.
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.
setNamedRange(name, range)voidNames a range.
setRowHeight(rowPosition, height)SheetSets the row height of the given row in pixels.
setSpreadsheetLocale(locale)voidSets the spreadsheet locale.
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).

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.
CopyPasteTypeCopyPasteTypeAn enumeration of the possible paste types.
DataValidationCriteriaDataValidationCriteriaAn enumeration representing the data validation criteria that can be set on a range.
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.
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.
RelativeDateRelativeDateAn enumeration of relative date options for calculating a value to be used in date-based BooleanCriteria.
TextDirectionTextDirectionAn enumeration of valid text directions.
TextToColumnsDelimiterTextToColumnsDelimiterAn enumeration of the preset delimiters for split text to columns.
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.
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()RangeListReturns 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()RangeReturns 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.
newConditionalFormatRule()ConditionalFormatRuleBuilderCreates a builder for a conditional formatting rule.
newDataValidation()DataValidationBuilderCreates a builder for a data validation rule.
newFilterCriteria()FilterCriteriaBuilderCreates a builder for a FilterCriteria.
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.

TextDirection

Properties

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

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.

TextToColumnsDelimiter

Properties

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

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.

Enviar comentarios sobre...