This service allows scripts to create, access, and modify Google Sheets files. See also the guide to storing data in spreadsheets.
Classes
Name | Brief description |
---|---|
ContainerInfo | The chart's position within a sheet. |
DataValidation | This class allows users to access existing data-validation rules. |
DataValidationBuilder | Builder for data-validation rules. |
DataValidationCriteria | An enumeration representing the data-validation criteria that can be set on a range. |
EmbeddedAreaChartBuilder | Builder for area charts. |
EmbeddedBarChartBuilder | Builder for bar charts. |
EmbeddedChart | Represents a chart that has been embedded into a Spreadsheet. |
EmbeddedChartBuilder | This builder allows you to edit an EmbeddedChart . |
EmbeddedColumnChartBuilder | Builder for column charts. |
EmbeddedLineChartBuilder | Builder for line charts. |
EmbeddedPieChartBuilder | Builder for pie charts. |
EmbeddedScatterChartBuilder | Builder for scatter charts. |
EmbeddedTableChartBuilder | Builder for table charts. |
| Access and modify protected sheets in the older version of Google Sheets. |
Protection | Access and modify protected ranges and sheets. |
ProtectionType | An enumeration representing the parts of a spreadsheet that can be protected from edits. |
Range | Access and modify spreadsheet ranges. |
Sheet | Access and modify spreadsheet sheets. |
Spreadsheet | This class allows users to access and modify Google Sheets files. |
SpreadsheetApp | This class allows users to open Google Sheets files and to create new ones. |
Class ContainerInfo
Methods
Method | Return type | Brief description |
---|---|---|
getAnchorColumn() | Integer | The chart's left side will be anchored in this column. |
getAnchorRow() | Integer | The chart's top side will be anchored in this row. |
getOffsetX() | Integer | The chart's upper left hand corner will be offset from the anchor column by this many pixels. |
getOffsetY() | Integer | Chart's upper left hand corner will be offset from the anchor row by this many pixels. |
Class DataValidation
Methods
Method | Return type | Brief description |
---|---|---|
copy() | DataValidationBuilder | Creates a builder for a data-validation rule based on this rule's settings. |
getAllowInvalid() | Boolean | Returns true if the rule shows a warning when input fails data validation, or
false if it rejects the input entirely. |
getCriteriaType() | DataValidationCriteria | Gets the rule's criteria type as defined in the DataValidationCriteria enum. |
getCriteriaValues() | Object[] | Gets an array of arguments for the rule's criteria. |
getHelpText() | String | Gets the rule's help text, or null if no help text is set. |
Class DataValidationBuilder
Methods
Method | Return type | Brief description |
---|---|---|
build() | DataValidation | Constructs a data-validation rule from the settings applied to the builder. |
copy() | DataValidationBuilder | Creates a builder for a data-validation rule based on this rule's settings. |
getAllowInvalid() | Boolean | Returns true if the rule shows a warning when input fails data validation, or
false if it rejects the input entirely. |
getCriteriaType() | DataValidationCriteria | Gets the rule's criteria type as defined in the DataValidationCriteria enum. |
getCriteriaValues() | Object[] | Gets an array of arguments for the rule's criteria. |
getHelpText() | String | Gets the rule's help text, or null if no help text is set. |
requireDate() | DataValidationBuilder | Sets the data-validation rule to require a date. |
requireDateAfter(date) | DataValidationBuilder | Sets the data-validation rule to require a date after the given value. |
requireDateBefore(date) | DataValidationBuilder | Sets the data-validation rule to require a date before the given value. |
requireDateBetween(start, end) | DataValidationBuilder | Sets the data-validation rule to require a date between the given values, inclusive of the values themselves. |
requireDateEqualTo(date) | DataValidationBuilder | Sets the data-validation rule to require a date equal to the given value. |
requireDateNotBetween(start, end) | DataValidationBuilder | Sets the data-validation rule to require a date not between the given values, inclusive of the values themselves. |
requireDateOnOrAfter(date) | DataValidationBuilder | Sets the data-validation rule to require a date on or after the given value. |
requireDateOnOrBefore(date) | DataValidationBuilder | Sets the data-validation rule to require a date on or before the given value. |
requireFormulaSatisfied(formula) | DataValidationBuilder | Sets the data-validation rule to require that the given formula evaluates to true . |
requireNumberBetween(start, end) | DataValidationBuilder | Sets the data-validation rule to require a number between the given values, inclusive of the values themselves. |
requireNumberEqualTo(number) | DataValidationBuilder | Sets the data-validation rule to require a number equal to the given value. |
requireNumberGreaterThan(number) | DataValidationBuilder | Sets the data-validation rule to require a number greater than the given value. |
requireNumberGreaterThanOrEqualTo(number) | DataValidationBuilder | Sets the data-validation rule to require a number greater than or equal to the given value. |
requireNumberLessThan(number) | DataValidationBuilder | Sets the data-validation rule to require a number less than the given value. |
requireNumberLessThanOrEqualTo(number) | DataValidationBuilder | Sets the data-validation rule to require a number less than or equal to the given value. |
requireNumberNotBetween(start, end) | DataValidationBuilder | Sets the data-validation rule to require a number not between the given values, inclusive of the values themselves. |
requireNumberNotEqualTo(number) | DataValidationBuilder | Sets the data-validation rule to require a number not equal to the given value. |
requireTextContains(text) | DataValidationBuilder | Sets the data-validation rule to require that the input contains the given value. |
requireTextDoesNotContain(text) | DataValidationBuilder | Sets the data-validation rule to require that the input does not contain the given value. |
requireTextEqualTo(text) | DataValidationBuilder | Sets the data-validation rule to require that the input is equal to the given value. |
requireTextIsEmail() | DataValidationBuilder | Sets the data-validation rule to require that the input is in the form of an email address. |
requireTextIsUrl() | DataValidationBuilder | Sets the data-validation rule to require that the input is in the form of a URL. |
requireValueInList(values) | DataValidationBuilder | Sets the data-validation rule to require that the input is equal to one of the given values. |
requireValueInList(values, showDropdown) | DataValidationBuilder | Sets 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) | DataValidationBuilder | Sets the data-validation rule to require that the input is equal to a value in the given range. |
requireValueInRange(range, showDropdown) | DataValidationBuilder | Sets 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) | DataValidationBuilder | Sets whether to show a warning when input fails data validation or whether to reject the input entirely. |
setHelpText(helpText) | DataValidationBuilder | Sets the help text shown when the user hovers over the cell on which data-validation is set. |
withCriteria(criteria, args) | DataValidationBuilder | Sets the data-validation rule to require criteria defined in the DataValidationCriteria
enum. |
Class DataValidationCriteria
Properties
Property | Type | Description |
---|---|---|
DATE_AFTER | Enum | Requires a date that is after the given value. |
DATE_BEFORE | Enum | Requires a date that is before the given value. |
DATE_BETWEEN | Enum | Requires a date that is between the given values. |
DATE_EQUAL_TO | Enum | Requires a date that is equal to the given value. |
DATE_IS_VALID_DATE | Enum | Requires a date. |
DATE_NOT_BETWEEN | Enum | Requires a date that is not between the given values. |
DATE_ON_OR_AFTER | Enum | Require a date that is on or after the given value. |
DATE_ON_OR_BEFORE | Enum | Requires a date that is on or before the given value. |
NUMBER_BETWEEN | Enum | Requires a number that is between the given values. |
NUMBER_EQUAL_TO | Enum | Requires a number that is equal to the given value. |
NUMBER_GREATER_THAN | Enum | Require a number that is greater than the given value. |
NUMBER_GREATER_THAN_OR_EQUAL_TO | Enum | Requires a number that is greater than or equal to the given value. |
NUMBER_LESS_THAN | Enum | Requires a number that is less than the given value. |
NUMBER_LESS_THAN_OR_EQUAL_TO | Enum | Requires a number that is less than or equal to the given value. |
NUMBER_NOT_BETWEEN | Enum | Requires a number that is not between the given values. |
NUMBER_NOT_EQUAL_TO | Enum | Requires a number that is not equal to the given value. |
TEXT_CONTAINS | Enum | Requires that the input contains the given value. |
TEXT_DOES_NOT_CONTAIN | Enum | Requires that the input does not contain the given value. |
TEXT_EQUAL_TO | Enum | Requires that the input is equal to the given value. |
TEXT_IS_VALID_EMAIL | Enum | Requires that the input is in the form of an email address. |
TEXT_IS_VALID_URL | Enum | Requires that the input is in the form of a URL. |
VALUE_IN_LIST | Enum | Requires that the input is equal to one of the given values. |
VALUE_IN_RANGE | Enum | Requires that the input is equal to a value in the given range. |
CUSTOM_FORMULA | Enum | Requires that the input makes the given formula evaluate to true . |
Class EmbeddedAreaChartBuilder
Methods
Method | Return type | Brief description |
---|---|---|
addRange(range) | EmbeddedChartBuilder | Adds a Range to the chart represented by this builder. |
asAreaChart() | EmbeddedAreaChartBuilder | Sets the chart type to AreaChart and returns an EmbeddedAreaChartBuilder . |
asBarChart() | EmbeddedBarChartBuilder | Sets the chart type to BarChart and returns an EmbeddedBarChartBuilder . |
asColumnChart() | EmbeddedColumnChartBuilder | Sets the chart type to ColumnChart and returns an EmbeddedColumnChartBuilder . |
asLineChart() | EmbeddedLineChartBuilder | Sets the chart type to LineChart and returns an EmbeddedLineChartBuilder . |
asPieChart() | EmbeddedPieChartBuilder | Sets the chart type to PieChart and returns an EmbeddedPieChartBuilder . |
asScatterChart() | EmbeddedScatterChartBuilder | Sets the chart type to ScatterChart and returns an EmbeddedScatterChartBuilder . |
asTableChart() | EmbeddedTableChartBuilder | Sets the chart type to TableChart and returns an EmbeddedTableChartBuilder . |
build() | EmbeddedChart | Builds the chart to reflect all changes made to it. |
getChartType() | ChartType | Returns the current chart type. |
getContainer() | ContainerInfo | Return the 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) | EmbeddedChartBuilder | Removes the specified Range from the chart represented by this builder. |
reverseCategories() | EmbeddedAreaChartBuilder | Reverses the drawing of series in the domain axis. |
setBackgroundColor(cssValue) | EmbeddedAreaChartBuilder | Sets the background color for the chart. |
setChartType(type) | EmbeddedChartBuilder | Changes the type of chart. |
setColors(cssValues) | EmbeddedAreaChartBuilder | Sets the colors for the lines in the chart. |
setLegendPosition(position) | EmbeddedAreaChartBuilder | Sets the position of the legend with respect to the chart. |
setLegendTextStyle(textStyle) | EmbeddedAreaChartBuilder | Sets the text style of the chart legend. |
setOption(option, value) | EmbeddedChartBuilder |
Sets advanced options for this chart. |
setPointStyle(style) | EmbeddedAreaChartBuilder | Sets the style for points in the line. |
setPosition(anchorRowPos, anchorColPos, offsetX, offsetY) | EmbeddedChartBuilder | Sets the position, changing where the chart appears on the sheet. |
setRange(start, end) | EmbeddedAreaChartBuilder | Sets the range for the chart. |
setStacked() | EmbeddedAreaChartBuilder | Uses stacked lines, meaning that line and bar values are stacked (accumulated). |
setTitle(chartTitle) | EmbeddedAreaChartBuilder | Sets the title of the chart. |
setTitleTextStyle(textStyle) | EmbeddedAreaChartBuilder | Sets the text style of the chart title. |
setXAxisTextStyle(textStyle) | EmbeddedAreaChartBuilder | Sets the horizontal axis text style. |
setXAxisTitle(title) | EmbeddedAreaChartBuilder | Adds a title to the horizontal axis. |
setXAxisTitleTextStyle(textStyle) | EmbeddedAreaChartBuilder | Sets the horizontal axis title text style. |
setYAxisTextStyle(textStyle) | EmbeddedAreaChartBuilder | Sets the vertical axis text style. |
setYAxisTitle(title) | EmbeddedAreaChartBuilder | Adds a title to the vertical axis. |
setYAxisTitleTextStyle(textStyle) | EmbeddedAreaChartBuilder | Sets the vertical axis title text style. |
useLogScale() | EmbeddedAreaChartBuilder | Makes the range axis into a logarithmic scale (requires all values to be positive). |
Class EmbeddedBarChartBuilder
Methods
Method | Return type | Brief description |
---|---|---|
addRange(range) | EmbeddedChartBuilder | Adds a Range to the chart represented by this builder. |
asAreaChart() | EmbeddedAreaChartBuilder | Sets the chart type to AreaChart and returns an EmbeddedAreaChartBuilder . |
asBarChart() | EmbeddedBarChartBuilder | Sets the chart type to BarChart and returns an EmbeddedBarChartBuilder . |
asColumnChart() | EmbeddedColumnChartBuilder | Sets the chart type to ColumnChart and returns an EmbeddedColumnChartBuilder . |
asLineChart() | EmbeddedLineChartBuilder | Sets the chart type to LineChart and returns an EmbeddedLineChartBuilder . |
asPieChart() | EmbeddedPieChartBuilder | Sets the chart type to PieChart and returns an EmbeddedPieChartBuilder . |
asScatterChart() | EmbeddedScatterChartBuilder | Sets the chart type to ScatterChart and returns an EmbeddedScatterChartBuilder . |
asTableChart() | EmbeddedTableChartBuilder | Sets the chart type to TableChart and returns an EmbeddedTableChartBuilder . |
build() | EmbeddedChart | Builds the chart to reflect all changes made to it. |
getChartType() | ChartType | Returns the current chart type. |
getContainer() | ContainerInfo | Return the 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) | EmbeddedChartBuilder | Removes the specified Range from the chart represented by this builder. |
reverseCategories() | EmbeddedBarChartBuilder | Reverses the drawing of series in the domain axis. |
reverseDirection() | EmbeddedBarChartBuilder | Reverses the direction in which the bars grow along the horizontal axis. |
setBackgroundColor(cssValue) | EmbeddedBarChartBuilder | Sets the background color for the chart. |
setChartType(type) | EmbeddedChartBuilder | Changes the type of chart. |
setColors(cssValues) | EmbeddedBarChartBuilder | Sets the colors for the lines in the chart. |
setLegendPosition(position) | EmbeddedBarChartBuilder | Sets the position of the legend with respect to the chart. |
setLegendTextStyle(textStyle) | EmbeddedBarChartBuilder | Sets the text style of the chart legend. |
setOption(option, value) | EmbeddedChartBuilder |
Sets advanced options for this chart. |
setPosition(anchorRowPos, anchorColPos, offsetX, offsetY) | EmbeddedChartBuilder | Sets the position, changing where the chart appears on the sheet. |
setRange(start, end) | EmbeddedBarChartBuilder | Sets the range for the chart. |
setStacked() | EmbeddedBarChartBuilder | Uses stacked lines, meaning that line and bar values are stacked (accumulated). |
setTitle(chartTitle) | EmbeddedBarChartBuilder | Sets the title of the chart. |
setTitleTextStyle(textStyle) | EmbeddedBarChartBuilder | Sets the text style of the chart title. |
setXAxisTextStyle(textStyle) | EmbeddedBarChartBuilder | Sets the horizontal axis text style. |
setXAxisTitle(title) | EmbeddedBarChartBuilder | Adds a title to the horizontal axis. |
setXAxisTitleTextStyle(textStyle) | EmbeddedBarChartBuilder | Sets the horizontal axis title text style. |
setYAxisTextStyle(textStyle) | EmbeddedBarChartBuilder | Sets the vertical axis text style. |
setYAxisTitle(title) | EmbeddedBarChartBuilder | Adds a title to the vertical axis. |
setYAxisTitleTextStyle(textStyle) | EmbeddedBarChartBuilder | Sets the vertical axis title text style. |
useLogScale() | EmbeddedBarChartBuilder | Makes the range axis into a logarithmic scale (requires all values to be positive). |
Class EmbeddedChart
Methods
Method | Return type | Brief description |
---|---|---|
getAs(contentType) | Blob | Return the data inside this object as a blob converted to the specified content type. |
getBlob() | Blob | Return the data inside this object as a blob. |
getContainerInfo() | ContainerInfo | Returns information about where the chart is positioned within a sheet. |
getId() | String | Returns the id that has been assigned to this object. |
getOptions() | ChartOptions | Returns the options for this chart, such as height, colors, axes, etc. |
getRanges() | Range[] | Returns the Ranges that this chart uses as a data source. |
getType() | String | Gets the type of this object. |
modify() | EmbeddedChartBuilder | Returns an EmbeddedChartBuilder that can be used to modify this chart. |
setId(id) | Chart | Sets the id of this EmbeddedChart to be used with UiApp. |
Class EmbeddedChartBuilder
Methods
Method | Return type | Brief description |
---|---|---|
addRange(range) | EmbeddedChartBuilder | Adds a Range to the chart represented by this builder. |
asAreaChart() | EmbeddedAreaChartBuilder | Sets the chart type to AreaChart and returns an EmbeddedAreaChartBuilder . |
asBarChart() | EmbeddedBarChartBuilder | Sets the chart type to BarChart and returns an EmbeddedBarChartBuilder . |
asColumnChart() | EmbeddedColumnChartBuilder | Sets the chart type to ColumnChart and returns an EmbeddedColumnChartBuilder . |
asLineChart() | EmbeddedLineChartBuilder | Sets the chart type to LineChart and returns an EmbeddedLineChartBuilder . |
asPieChart() | EmbeddedPieChartBuilder | Sets the chart type to PieChart and returns an EmbeddedPieChartBuilder . |
asScatterChart() | EmbeddedScatterChartBuilder | Sets the chart type to ScatterChart and returns an EmbeddedScatterChartBuilder . |
asTableChart() | EmbeddedTableChartBuilder | Sets the chart type to TableChart and returns an EmbeddedTableChartBuilder . |
build() | EmbeddedChart | Builds the chart to reflect all changes made to it. |
getChartType() | ChartType | Returns the current chart type. |
getContainer() | ContainerInfo | Return the 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) | EmbeddedChartBuilder | Removes the specified Range from the chart represented by this builder. |
setChartType(type) | EmbeddedChartBuilder | Changes the type of chart. |
setOption(option, value) | EmbeddedChartBuilder |
Sets advanced options for this chart. |
setPosition(anchorRowPos, anchorColPos, offsetX, offsetY) | EmbeddedChartBuilder | Sets the position, changing where the chart appears on the sheet. |
Class EmbeddedColumnChartBuilder
Methods
Method | Return type | Brief description |
---|---|---|
addRange(range) | EmbeddedChartBuilder | Adds a Range to the chart represented by this builder. |
asAreaChart() | EmbeddedAreaChartBuilder | Sets the chart type to AreaChart and returns an EmbeddedAreaChartBuilder . |
asBarChart() | EmbeddedBarChartBuilder | Sets the chart type to BarChart and returns an EmbeddedBarChartBuilder . |
asColumnChart() | EmbeddedColumnChartBuilder | Sets the chart type to ColumnChart and returns an EmbeddedColumnChartBuilder . |
asLineChart() | EmbeddedLineChartBuilder | Sets the chart type to LineChart and returns an EmbeddedLineChartBuilder . |
asPieChart() | EmbeddedPieChartBuilder | Sets the chart type to PieChart and returns an EmbeddedPieChartBuilder . |
asScatterChart() | EmbeddedScatterChartBuilder | Sets the chart type to ScatterChart and returns an EmbeddedScatterChartBuilder . |
asTableChart() | EmbeddedTableChartBuilder | Sets the chart type to TableChart and returns an EmbeddedTableChartBuilder . |
build() | EmbeddedChart | Builds the chart to reflect all changes made to it. |
getChartType() | ChartType | Returns the current chart type. |
getContainer() | ContainerInfo | Return the 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) | EmbeddedChartBuilder | Removes the specified Range from the chart represented by this builder. |
reverseCategories() | EmbeddedColumnChartBuilder | Reverses the drawing of series in the domain axis. |
setBackgroundColor(cssValue) | EmbeddedColumnChartBuilder | Sets the background color for the chart. |
setChartType(type) | EmbeddedChartBuilder | Changes the type of chart. |
setColors(cssValues) | EmbeddedColumnChartBuilder | Sets the colors for the lines in the chart. |
setLegendPosition(position) | EmbeddedColumnChartBuilder | Sets the position of the legend with respect to the chart. |
setLegendTextStyle(textStyle) | EmbeddedColumnChartBuilder | Sets the text style of the chart legend. |
setOption(option, value) | EmbeddedChartBuilder |
Sets advanced options for this chart. |
setPosition(anchorRowPos, anchorColPos, offsetX, offsetY) | EmbeddedChartBuilder | Sets the position, changing where the chart appears on the sheet. |
setRange(start, end) | EmbeddedColumnChartBuilder | Sets the range for the chart. |
setStacked() | EmbeddedColumnChartBuilder | Uses stacked lines, meaning that line and bar values are stacked (accumulated). |
setTitle(chartTitle) | EmbeddedColumnChartBuilder | Sets the title of the chart. |
setTitleTextStyle(textStyle) | EmbeddedColumnChartBuilder | Sets the text style of the chart title. |
setXAxisTextStyle(textStyle) | EmbeddedColumnChartBuilder | Sets the horizontal axis text style. |
setXAxisTitle(title) | EmbeddedColumnChartBuilder | Adds a title to the horizontal axis. |
setXAxisTitleTextStyle(textStyle) | EmbeddedColumnChartBuilder | Sets the horizontal axis title text style. |
setYAxisTextStyle(textStyle) | EmbeddedColumnChartBuilder | Sets the vertical axis text style. |
setYAxisTitle(title) | EmbeddedColumnChartBuilder | Adds a title to the vertical axis. |
setYAxisTitleTextStyle(textStyle) | EmbeddedColumnChartBuilder | Sets the vertical axis title text style. |
useLogScale() | EmbeddedColumnChartBuilder | Makes the range axis into a logarithmic scale (requires all values to be positive). |
Class EmbeddedLineChartBuilder
Methods
Method | Return type | Brief description |
---|---|---|
addRange(range) | EmbeddedChartBuilder | Adds a Range to the chart represented by this builder. |
asAreaChart() | EmbeddedAreaChartBuilder | Sets the chart type to AreaChart and returns an EmbeddedAreaChartBuilder . |
asBarChart() | EmbeddedBarChartBuilder | Sets the chart type to BarChart and returns an EmbeddedBarChartBuilder . |
asColumnChart() | EmbeddedColumnChartBuilder | Sets the chart type to ColumnChart and returns an EmbeddedColumnChartBuilder . |
asLineChart() | EmbeddedLineChartBuilder | Sets the chart type to LineChart and returns an EmbeddedLineChartBuilder . |
asPieChart() | EmbeddedPieChartBuilder | Sets the chart type to PieChart and returns an EmbeddedPieChartBuilder . |
asScatterChart() | EmbeddedScatterChartBuilder | Sets the chart type to ScatterChart and returns an EmbeddedScatterChartBuilder . |
asTableChart() | EmbeddedTableChartBuilder | Sets the chart type to TableChart and returns an EmbeddedTableChartBuilder . |
build() | EmbeddedChart | Builds the chart to reflect all changes made to it. |
getChartType() | ChartType | Returns the current chart type. |
getContainer() | ContainerInfo | Return the 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) | EmbeddedChartBuilder | Removes the specified Range from the chart represented by this builder. |
reverseCategories() | EmbeddedLineChartBuilder | Reverses the drawing of series in the domain axis. |
setBackgroundColor(cssValue) | EmbeddedLineChartBuilder | Sets the background color for the chart. |
setChartType(type) | EmbeddedChartBuilder | Changes the type of chart. |
setColors(cssValues) | EmbeddedLineChartBuilder | Sets the colors for the lines in the chart. |
setCurveStyle(style) | EmbeddedLineChartBuilder | Sets the style to use for curves in the chart. |
setLegendPosition(position) | EmbeddedLineChartBuilder | Sets the position of the legend with respect to the chart. |
setLegendTextStyle(textStyle) | EmbeddedLineChartBuilder | Sets the text style of the chart legend. |
setOption(option, value) | EmbeddedChartBuilder |
Sets advanced options for this chart. |
setPointStyle(style) | EmbeddedLineChartBuilder | Sets the style for points in the line. |
setPosition(anchorRowPos, anchorColPos, offsetX, offsetY) | EmbeddedChartBuilder | Sets the position, changing where the chart appears on the sheet. |
setRange(start, end) | EmbeddedLineChartBuilder | Sets the range for the chart. |
setTitle(chartTitle) | EmbeddedLineChartBuilder | Sets the title of the chart. |
setTitleTextStyle(textStyle) | EmbeddedLineChartBuilder | Sets the text style of the chart title. |
setXAxisTextStyle(textStyle) | EmbeddedLineChartBuilder | Sets the horizontal axis text style. |
setXAxisTitle(title) | EmbeddedLineChartBuilder | Adds a title to the horizontal axis. |
setXAxisTitleTextStyle(textStyle) | EmbeddedLineChartBuilder | Sets the horizontal axis title text style. |
setYAxisTextStyle(textStyle) | EmbeddedLineChartBuilder | Sets the vertical axis text style. |
setYAxisTitle(title) | EmbeddedLineChartBuilder | Adds a title to the vertical axis. |
setYAxisTitleTextStyle(textStyle) | EmbeddedLineChartBuilder | Sets the vertical axis title text style. |
useLogScale() | EmbeddedLineChartBuilder | Makes the range axis into a logarithmic scale (requires all values to be positive). |
Class EmbeddedPieChartBuilder
Methods
Method | Return type | Brief description |
---|---|---|
addRange(range) | EmbeddedChartBuilder | Adds a Range to the chart represented by this builder. |
asAreaChart() | EmbeddedAreaChartBuilder | Sets the chart type to AreaChart and returns an EmbeddedAreaChartBuilder . |
asBarChart() | EmbeddedBarChartBuilder | Sets the chart type to BarChart and returns an EmbeddedBarChartBuilder . |
asColumnChart() | EmbeddedColumnChartBuilder | Sets the chart type to ColumnChart and returns an EmbeddedColumnChartBuilder . |
asLineChart() | EmbeddedLineChartBuilder | Sets the chart type to LineChart and returns an EmbeddedLineChartBuilder . |
asPieChart() | EmbeddedPieChartBuilder | Sets the chart type to PieChart and returns an EmbeddedPieChartBuilder . |
asScatterChart() | EmbeddedScatterChartBuilder | Sets the chart type to ScatterChart and returns an EmbeddedScatterChartBuilder . |
asTableChart() | EmbeddedTableChartBuilder | Sets the chart type to TableChart and returns an EmbeddedTableChartBuilder . |
build() | EmbeddedChart | Builds the chart to reflect all changes made to it. |
getChartType() | ChartType | Returns the current chart type. |
getContainer() | ContainerInfo | Return the 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) | EmbeddedChartBuilder | Removes the specified Range from the chart represented by this builder. |
reverseCategories() | EmbeddedPieChartBuilder | Reverses the drawing of series in the domain axis. |
set3D() | EmbeddedPieChartBuilder | Sets the chart to be three-dimensional. |
setBackgroundColor(cssValue) | EmbeddedPieChartBuilder | Sets the background color for the chart. |
setChartType(type) | EmbeddedChartBuilder | Changes the type of chart. |
setColors(cssValues) | EmbeddedPieChartBuilder | Sets the colors for the lines in the chart. |
setLegendPosition(position) | EmbeddedPieChartBuilder | Sets the position of the legend with respect to the chart. |
setLegendTextStyle(textStyle) | EmbeddedPieChartBuilder | Sets the text style of the chart legend. |
setOption(option, value) | EmbeddedChartBuilder |
Sets advanced options for this chart. |
setPosition(anchorRowPos, anchorColPos, offsetX, offsetY) | EmbeddedChartBuilder | Sets the position, changing where the chart appears on the sheet. |
setTitle(chartTitle) | EmbeddedPieChartBuilder | Sets the title of the chart. |
setTitleTextStyle(textStyle) | EmbeddedPieChartBuilder | Sets the text style of the chart title. |
Class EmbeddedScatterChartBuilder
Methods
Method | Return type | Brief description |
---|---|---|
addRange(range) | EmbeddedChartBuilder | Adds a Range to the chart represented by this builder. |
asAreaChart() | EmbeddedAreaChartBuilder | Sets the chart type to AreaChart and returns an EmbeddedAreaChartBuilder . |
asBarChart() | EmbeddedBarChartBuilder | Sets the chart type to BarChart and returns an EmbeddedBarChartBuilder . |
asColumnChart() | EmbeddedColumnChartBuilder | Sets the chart type to ColumnChart and returns an EmbeddedColumnChartBuilder . |
asLineChart() | EmbeddedLineChartBuilder | Sets the chart type to LineChart and returns an EmbeddedLineChartBuilder . |
asPieChart() | EmbeddedPieChartBuilder | Sets the chart type to PieChart and returns an EmbeddedPieChartBuilder . |
asScatterChart() | EmbeddedScatterChartBuilder | Sets the chart type to ScatterChart and returns an EmbeddedScatterChartBuilder . |
asTableChart() | EmbeddedTableChartBuilder | Sets the chart type to TableChart and returns an EmbeddedTableChartBuilder . |
build() | EmbeddedChart | Builds the chart to reflect all changes made to it. |
getChartType() | ChartType | Returns the current chart type. |
getContainer() | ContainerInfo | Return the 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) | EmbeddedChartBuilder | Removes the specified Range from the chart represented by this builder. |
setBackgroundColor(cssValue) | EmbeddedScatterChartBuilder | Sets the background color for the chart. |
setChartType(type) | EmbeddedChartBuilder | Changes the type of chart. |
setColors(cssValues) | EmbeddedScatterChartBuilder | Sets the colors for the lines in the chart. |
setLegendPosition(position) | EmbeddedScatterChartBuilder | Sets the position of the legend with respect to the chart. |
setLegendTextStyle(textStyle) | EmbeddedScatterChartBuilder | Sets the text style of the chart legend. |
setOption(option, value) | EmbeddedChartBuilder |
Sets advanced options for this chart. |
setPointStyle(style) | EmbeddedScatterChartBuilder | Sets the style for points in the line. |
setPosition(anchorRowPos, anchorColPos, offsetX, offsetY) | EmbeddedChartBuilder | Sets the position, changing where the chart appears on the sheet. |
setTitle(chartTitle) | EmbeddedScatterChartBuilder | Sets the title of the chart. |
setTitleTextStyle(textStyle) | EmbeddedScatterChartBuilder | Sets the text style of the chart title. |
setXAxisLogScale() | EmbeddedScatterChartBuilder | Makes the horizontal axis into a logarithmic scale (requires all values to be positive). |
setXAxisRange(start, end) | EmbeddedScatterChartBuilder | Sets the range for the horizontal axis of the chart. |
setXAxisTextStyle(textStyle) | EmbeddedScatterChartBuilder | Sets the horizontal axis text style. |
setXAxisTitle(title) | EmbeddedScatterChartBuilder | Adds a title to the horizontal axis. |
setXAxisTitleTextStyle(textStyle) | EmbeddedScatterChartBuilder | Sets the horizontal axis title text style. |
setYAxisLogScale() | EmbeddedScatterChartBuilder | Makes the vertical axis into a logarithmic scale (requires all values to be positive). |
setYAxisRange(start, end) | EmbeddedScatterChartBuilder | Sets the range for the vertical axis of the chart. |
setYAxisTextStyle(textStyle) | EmbeddedScatterChartBuilder | Sets the vertical axis text style. |
setYAxisTitle(title) | EmbeddedScatterChartBuilder | Adds a title to the vertical axis. |
setYAxisTitleTextStyle(textStyle) | EmbeddedScatterChartBuilder | Sets the vertical axis title text style. |
Class EmbeddedTableChartBuilder
Methods
Method | Return type | Brief description |
---|---|---|
addRange(range) | EmbeddedChartBuilder | Adds a Range to the chart represented by this builder. |
asAreaChart() | EmbeddedAreaChartBuilder | Sets the chart type to AreaChart and returns an EmbeddedAreaChartBuilder . |
asBarChart() | EmbeddedBarChartBuilder | Sets the chart type to BarChart and returns an EmbeddedBarChartBuilder . |
asColumnChart() | EmbeddedColumnChartBuilder | Sets the chart type to ColumnChart and returns an EmbeddedColumnChartBuilder . |
asLineChart() | EmbeddedLineChartBuilder | Sets the chart type to LineChart and returns an EmbeddedLineChartBuilder . |
asPieChart() | EmbeddedPieChartBuilder | Sets the chart type to PieChart and returns an EmbeddedPieChartBuilder . |
asScatterChart() | EmbeddedScatterChartBuilder | Sets the chart type to ScatterChart and returns an EmbeddedScatterChartBuilder . |
asTableChart() | EmbeddedTableChartBuilder | Sets the chart type to TableChart and returns an EmbeddedTableChartBuilder . |
build() | EmbeddedChart | Builds the chart to reflect all changes made to it. |
enablePaging(enablePaging) | EmbeddedTableChartBuilder | Sets whether to enable paging through the data. |
enablePaging(pageSize) | EmbeddedTableChartBuilder | Enables paging and sets the number of rows in each page. |
enablePaging(pageSize, startPage) | EmbeddedTableChartBuilder | Enables paging, sets the number of rows in each page and the first table page to display (page numbers are zero based). |
enableRtlTable(rtlEnabled) | EmbeddedTableChartBuilder | Adds 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) | EmbeddedTableChartBuilder | Sets whether to sort columns when the user clicks a column heading. |
getChartType() | ChartType | Returns the current chart type. |
getContainer() | ContainerInfo | Return the 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) | EmbeddedChartBuilder | Removes the specified Range from the chart represented by this builder. |
setChartType(type) | EmbeddedChartBuilder | Changes the type of chart. |
setFirstRowNumber(number) | EmbeddedTableChartBuilder | Sets the row number for the first row in the data table. |
setInitialSortingAscending(column) | EmbeddedTableChartBuilder | Sets the index of the column according to which the table should be initially sorted (ascending). |
setInitialSortingDescending(column) | EmbeddedTableChartBuilder | Sets the index of the column according to which the table should be initially sorted (descending). |
setOption(option, value) | EmbeddedChartBuilder |
Sets advanced options for this chart. |
setPosition(anchorRowPos, anchorColPos, offsetX, offsetY) | EmbeddedChartBuilder | Sets the position, changing where the chart appears on the sheet. |
showRowNumberColumn(showRowNumber) | EmbeddedTableChartBuilder | Sets whether to show the row number as the first column of the table. |
useAlternatingRowStyle(alternate) | EmbeddedTableChartBuilder | Sets whether alternating color style will be assigned to odd and even rows of a table chart. |
Class PageProtection
Class Protection
Methods
Method | Return type | Brief description |
---|---|---|
addEditor(emailAddress) | Protection | Adds the given user to the list of editors for the protected sheet or range. |
addEditor(user) | Protection | Adds the given user to the list of editors for the protected sheet or range. |
addEditors(emailAddresses) | Protection | Adds the given array of users to the list of editors for the protected sheet or range. |
canDomainEdit() | Boolean | Determines whether all users in the domain that owns the spreadsheet have permission to edit the protected range or sheet. |
canEdit() | Boolean | Determines whether the user has permission to edit the protected range or sheet. |
getDescription() | String | Gets the description of the protected range or sheet. |
getEditors() | User[] | Gets the list of editors for the protected range or sheet. |
getProtectionType() | ProtectionType | Gets the type of the protected area, either SpreadsheetApp.ProtectionType.RANGE or
SpreadsheetApp.ProtectionType.SHEET . |
getRange() | Range | Gets the range that is being protected. |
getRangeName() | String | Gets 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. |
remove() | void | Unprotects the range or sheet. |
removeEditor(emailAddress) | Protection | Removes the given user from the list of editors for the protected sheet or range. |
removeEditor(user) | Protection | Removes the given user from the list of editors for the protected sheet or range. |
removeEditors(emailAddresses) | Protection | Removes the given array of users from the list of editors for the protected sheet or range. |
setDescription(description) | Protection | Sets the description of the protected range or sheet. |
setDomainEdit(editable) | Protection | Sets whether all users in the domain that owns the spreadsheet have permission to edit the protected range or sheet. |
setRange(range) | Protection | Adjusts the range that is being protected. |
setRangeName(rangeName) | Protection | Associates the protected range with an existing named range. |
setUnprotectedRanges(ranges) | Protection | Unprotects the given array of ranges within a protected sheet. |
Class ProtectionType
Properties
Property | Type | Description |
---|---|---|
RANGE | Enum | Protection for a range. |
SHEET | Enum | Protection for a sheet. |
Class Range
Methods
Method | Return type | Brief description |
---|---|---|
activate() | Range | Make this range the active range. |
breakApart() | Range | Break any multi-column cells in the range into individual cells again. |
canEdit() | Boolean | Determines whether the user has permission to edit every cell in the range. |
clear() | Range | Clears the range of contents, formats, and data-validation rules. |
clear(options) | Range | Clears the range of contents, format, data-validation rules, and/or comments, as specified with the given advanced options. |
clearContent() | Range | Clears the content of the range, leaving the formatting intact. |
clearDataValidations() | Range | Clears the data-validation rules for the range. |
clearFormat() | Range | Clears formatting for this range. |
clearNote() | Range | Clears the note in the given cell or cells. |
copyFormatToRange(gridId, column, columnEnd, row, rowEnd) | void | Copy the formatting of the range to the given location. |
copyFormatToRange(sheet, column, columnEnd, row, rowEnd) | void | Copy the formatting of the range to the given location. |
copyTo(destination) | void | Copies the data from a range of cells to another range of cells. |
copyTo(destination, options) | void | Copies the data from a range of cells to another range of cells. |
copyValuesToRange(gridId, column, columnEnd, row, rowEnd) | void | Copy the content of the range to the given location. |
copyValuesToRange(sheet, column, columnEnd, row, rowEnd) | void | Copy the content of the range to the given location. |
getA1Notation() | String | Returns a string description of the range, in A1 notation. |
getBackground() | String | Returns 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' ). |
getCell(row, column) | Range | Returns a given cell within a range. |
getColumn() | Integer | Returns the starting column position for this range. |
getDataSourceUrl() | String | Returns a URL for the data in this range, which can be used to create charts and queries. |
getDataTable() | DataTable | Return the data inside this object as a DataTable. |
getDataTable(firstRowIsHeader) | DataTable | Return the data inside this Range as a DataTable. |
getDataValidation() | DataValidation | Returns 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. |
getFontColor() | String | Returns the font color of the cell in the top-left corner of the range, in CSS notation
(like '#ffffff' or 'white' ). |
getFontColors() | String[][] | Returns the font colors of the cells in the range in CSS notation (like '#ffffff' or
'white' ). |
getFontFamilies() | String[][] | Returns the font families of the cells in the range. |
getFontFamily() | String | Returns the font family of the cell in the top-left corner of the range. |
getFontLine() | String | Gets 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() | Integer | Returns 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() | String | Returns 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() | String | Returns 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() | String | Returns 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() | String | Returns 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() | Integer | Returns the grid ID of the range's parent sheet. |
getHeight() | Integer | Returns the height of the range. |
getHorizontalAlignment() | String | Returns 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() | Integer | Returns the end column position. |
getLastRow() | Integer | Returns the end row position. |
getNote() | String | Returns the note associated with the given range. |
getNotes() | String[][] | Returns the notes associated with the cells in the range. |
getNumColumns() | Integer | Returns the number of columns in this range. |
getNumRows() | Integer | Returns the number of rows in this range. |
getNumberFormat() | String | Get the number formatting of the top-left cell of the given range. |
getNumberFormats() | String[][] | Returns the number formats for the cells in the range. |
getRow() | Integer | Returns the row position for this range. |
getRowIndex() | Integer | Returns the row position for this range. |
getSheet() | Sheet | Returns the sheet this range belongs to. |
getValue() | Object | Returns the value of the top-left cell in the range. |
getValues() | Object[][] | Returns the rectangular grid of values for this range. |
getVerticalAlignment() | String | Returns 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() | Integer | Returns the width of the range in columns. |
getWrap() | Boolean | Returns the wrapping policy of the cell in the top-left corner of the range. |
getWraps() | Boolean[][] | Returns the wrapping policy of the cells in the range. |
isBlank() | Boolean | Returns true if the range is totally blank. |
isEndColumnBounded() | Boolean | Determines whether the end of the range is bound to a particular column. |
isEndRowBounded() | Boolean | Determines whether the end of the range is bound to a particular row. |
isStartColumnBounded() | Boolean | Determines whether the start of the range is bound to a particular column. |
isStartRowBounded() | Boolean | Determines whether the start of the range is bound to a particular row. |
merge() | Range | Merges the cells in the range together into a single block. |
mergeAcross() | Range | Merge the cells in the range across the columns of the range. |
mergeVertically() | Range | Merges the cells in the range together. |
moveTo(target) | void | Cut and paste (both format and values) from this range to the target range. |
offset(rowOffset, columnOffset) | Range | Returns 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) | Range | Returns 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) | Range | Returns 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() | Protection | Creates an object that can protect the range from being edited except by users who have permission. |
setBackground(color) | Range | Sets the background color of all cells in the range in CSS notation (like '#ffffff' or
'white' ). |
setBackgroundRGB(red, green, blue) | Range | Sets the background to the given RGB color. |
setBackgrounds(color) | Range | Sets a rectangular grid of background colors (must match dimensions of this range). |
setBorder(top, left, bottom, right, vertical, horizontal) | Range | Sets the border property. |
setDataValidation(rule) | Range | Sets one data-validation rule for all cells in the range. |
setDataValidations(rules) | Range | Sets the data-validation rules for all cells in the range. |
setFontColor(color) | Range | Sets the font color in CSS notation (like '#ffffff' or 'white' ). |
setFontColors(colors) | Range | Sets a rectangular grid of font colors (must match dimensions of this range). |
setFontFamilies(fontFamilies) | Range | Sets a rectangular grid of font families (must match dimensions of this range). |
setFontFamily(fontFamily) | Range | Sets the font family, such as "Arial" or "Helvetica". |
setFontLine(fontLine) | Range | Sets the line style of the given range ('underline' , 'line-through' , or
'none' ). |
setFontLines(fontLines) | Range | Sets a rectangular grid of line styles (must match dimensions of this range). |
setFontSize(size) | Range | Sets the font size, with the size being the point size to use. |
setFontSizes(sizes) | Range | Sets a rectangular grid of font sizes (must match dimensions of this range). |
setFontStyle(fontStyle) | Range | Set the font style for the given range ('italic' or 'normal' ). |
setFontStyles(fontStyles) | Range | Sets a rectangular grid of font styles (must match dimensions of this range). |
setFontWeight(fontWeight) | Range | Set the font weight for the given range (normal/bold). |
setFontWeights(fontWeights) | Range | Sets a rectangular grid of font weights (must match dimensions of this range). |
setFormula(formula) | Range | Updates the formula for this range. |
setFormulaR1C1(formula) | Range | Updates the formula for this range. |
setFormulas(formulas) | Range | Sets a rectangular grid of formulas (must match dimensions of this range). |
setFormulasR1C1(formulas) | Range | Sets a rectangular grid of formulas (must match dimensions of this range). |
setHorizontalAlignment(alignment) | Range | Set the horizontal (left to right) alignment for the given range (left/center/right). |
setHorizontalAlignments(alignments) | Range | Sets a rectangular grid of horizontal alignments. |
setNote(note) | Range | Sets the note to the given value. |
setNotes(notes) | Range | Sets a rectangular grid of notes (must match dimensions of this range). |
setNumberFormat(numberFormat) | Range | Sets the number or date format to the given formatting string. |
setNumberFormats(numberFormats) | Range | Sets a rectangular grid of number or date formats (must match dimensions of this range). |
setValue(value) | Range | Sets the value of the range. |
setValues(values) | Range | Sets a rectangular grid of values (must match dimensions of this range). |
setVerticalAlignment(alignment) | Range | Set the vertical (top to bottom) alignment for the given range (top/middle/bottom). |
setVerticalAlignments(alignments) | Range | Sets a rectangular grid of vertical alignments (must match dimensions of this range). |
setWrap(isWrapEnabled) | Range | Set the cell wrap of the given range. |
setWraps(isWrapEnabled) | Range | Sets a rectangular grid of word wrap policies (must match dimensions of this range). |
sort(sortSpecObj) | Range | Sorts the cells in the given range. |
Class Sheet
Methods
Method | Return type | Brief description |
---|---|---|
activate() | Sheet | Activates this sheet. |
appendRow(rowContents) | Sheet | Appends a row to the spreadsheet. |
autoResizeColumn(columnPosition) | Sheet | Sets the width of the given column to fit its contents |
clear() | Sheet | Clears the sheet of content and formatting information. |
clear(options) | Sheet | Clears the sheet of contents and/or format, as specified with the given advanced options. |
clearContents() | Sheet | Clears the sheet of contents, while preserving formatting information. |
clearFormats() | Sheet | Clears the sheet of formatting, while preserving contents. |
clearNotes() | Sheet | Clears the sheet of all notes. |
copyTo(spreadsheet) | Sheet | Copies the sheet to a given spreadsheet, which can be the same spreadsheet as the source. |
deleteColumn(columnPosition) | Sheet | Deletes the column at the given column position. |
deleteColumns(columnPosition, howMany) | void | Deletes a number of columns starting at the given column position. |
deleteRow(rowPosition) | Sheet | Deletes the row at the given row position. |
deleteRows(rowPosition, howMany) | void | Deletes a number of rows starting at the given row position. |
getActiveCell() | Range | Returns the active cell in this sheet. |
getActiveRange() | Range | Returns the active range for the active sheet. |
getCharts() | EmbeddedChart[] | Returns an array of charts on this sheet. |
getColumnWidth(columnPosition) | Integer | Gets the width in pixels of the given column. |
getDataRange() | Range | Returns a Range corresponding to the dimensions in which data is present. |
getFrozenColumns() | Integer | Returns the number of frozen columns. |
getFrozenRows() | Integer | Returns the number of frozen rows. |
getIndex() | Integer | Gets the position of the sheet in its parent spreadsheet. |
getLastColumn() | Integer | Returns the position of the last column that has content. |
getLastRow() | Integer | Returns the position of the last row that has content. |
getMaxColumns() | Integer | The maximum width of the sheet, regardless of content. |
getMaxRows() | Integer | The maximum height of the sheet, regardless of content. |
getName() | String | Returns the name of the sheet. |
getParent() | Spreadsheet | Returns the Spreadsheet that contains 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) | Range | Returns the range with the top left cell at the given coordinates. |
getRange(row, column, numRows) | Range | Returns the range with the top left cell at the given coordinates, and with the given number of rows. |
getRange(row, column, numRows, numColumns) | Range | Returns the range with the top left cell at the given coordinates with the given number of rows and columns. |
getRange(a1Notation) | Range | Returns the range as specified in A1 notation or R1C1 notation. |
getRowHeight(rowPosition) | Integer | Gets the height in pixels of the given row. |
getSheetId() | Integer | Returns the ID of the sheet represented by this object. |
getSheetName() | String | Returns the sheet name. |
getSheetValues(startRow, startColumn, numRows, numColumns) | Object[][] | Returns the rectangular grid of values for this range starting at the given coordinates. |
hideColumn(column) | void | Hides the columns in the given range. |
hideColumns(columnIndex) | void | Hides the column at the given index. |
hideColumns(columnIndex, numColumns) | void | Hides one or more consecutive columns starting at the given index. |
hideRow(row) | void | Hides the rows in the given range. |
hideRows(rowIndex) | void | Hides the row at the given index. |
hideRows(rowIndex, numRows) | void | Hides one or more consecutive rows starting at the given index. |
hideSheet() | Sheet | Hides this sheet. |
insertChart(chart) | void | Adds a new chart to this sheet. |
insertColumnAfter(afterPosition) | Sheet | Inserts a column after the given column position. |
insertColumnBefore(beforePosition) | Sheet | Inserts a column before the given column position. |
insertColumns(columnIndex) | void | Inserts a blank column in a sheet at the specified location. |
insertColumns(columnIndex, numColumns) | void | Inserts one or more consecutive blank columns in a sheet starting at the specified location. |
insertColumnsAfter(afterPosition, howMany) | Sheet | Inserts a number of columns after the given column position. |
insertColumnsBefore(beforePosition, howMany) | Sheet | Inserts a number of columns before the given column position. |
insertImage(blob, column, row) | void | Inserts a Blob as an image in the document at a given row and column. |
insertImage(blob, column, row, offsetX, offsetY) | void | Inserts a Blob as an image in the document at a given row and column, with a pixel
offset. |
insertImage(url, column, row) | void | Inserts an image in the document at a given row and column. |
insertImage(url, column, row, offsetX, offsetY) | void | Inserts an image in the document at a given row and column, with a pixel offset. |
insertRowAfter(afterPosition) | Sheet | Inserts a row after the given row position. |
insertRowBefore(beforePosition) | Sheet | Inserts a row before the given row position. |
insertRows(rowIndex) | void | Inserts a blank row in a sheet at the specified location. |
insertRows(rowIndex, numRows) | void | Inserts one or more consecutive blank rows in a sheet starting at the specified location. |
insertRowsAfter(afterPosition, howMany) | Sheet | Inserts a number of rows after the given row position. |
insertRowsBefore(beforePosition, howMany) | Sheet | Inserts a number of rows before the given row position. |
isSheetHidden() | Boolean | Returns true if the sheet is currently hidden. |
newChart() | EmbeddedChartBuilder | Returns a builder to create a new chart for this sheet. |
protect() | Protection | Creates an object that can protect the sheet from being edited except by users who have permission. |
removeChart(chart) | void | Removes a chart from the parent sheet. |
setActiveRange(range) | Range | Sets the active range for the active sheet. |
setActiveSelection(range) | Range | Sets the active selection region for this sheet. |
setActiveSelection(a1Notation) | Range | Sets the active selection, as specified in A1 notation or R1C1 notation. |
setColumnWidth(columnPosition, width) | Sheet | Sets the width of the given column in pixels. |
setFrozenColumns(columns) | void | Freezes the given number of columns. |
setFrozenRows(rows) | void | Freezes the given number of rows. |
setName(name) | Sheet | Sets the sheet name. |
setRowHeight(rowPosition, height) | Sheet | Sets the row height of the given row in pixels. |
showColumns(columnIndex) | void | Unhides the column at the given index. |
showColumns(columnIndex, numColumns) | void | Unhides one or more consecutive columns starting at the given index. |
showRows(rowIndex) | void | Unhides the row at the given index. |
showRows(rowIndex, numRows) | void | Unhides one or more consecutive rows starting at the given index. |
showSheet() | Sheet | Makes the sheet visible. |
sort(columnPosition) | Sheet | Sorts a sheet by column, ascending. |
sort(columnPosition, ascending) | Sheet | Sorts a sheet by column. |
unhideColumn(column) | void | Unhides the column in the given range. |
unhideRow(row) | void | Unhides the row in the given range. |
updateChart(chart) | void | Updates the chart on this sheet. |
Class Spreadsheet
Methods
Method | Return type | Brief description |
---|---|---|
addEditor(emailAddress) | Spreadsheet | Adds the given user to the list of editors for the Spreadsheet . |
addEditor(user) | Spreadsheet | Adds the given user to the list of editors for the Spreadsheet . |
addEditors(emailAddresses) | Spreadsheet | Adds the given array of users to the list of editors for the Spreadsheet . |
addMenu(name, subMenus) | void | Creates a new menu in the Spreadsheet UI. |
addViewer(emailAddress) | Spreadsheet | Adds the given user to the list of viewers for the Spreadsheet . |
addViewer(user) | Spreadsheet | Adds the given user to the list of viewers for the Spreadsheet . |
addViewers(emailAddresses) | Spreadsheet | Adds the given array of users to the list of viewers for the Spreadsheet . |
appendRow(rowContents) | Sheet | Appends a row to the spreadsheet. |
autoResizeColumn(columnPosition) | Sheet | Sets the width of the given column to fit its contents |
copy(name) | Spreadsheet | Copies the spreadsheet and returns the new one. |
deleteActiveSheet() | Sheet | Deletes the currently active sheet. |
deleteColumn(columnPosition) | Sheet | Deletes the column at the given column position. |
deleteColumns(columnPosition, howMany) | void | Deletes a number of columns starting at the given column position. |
deleteRow(rowPosition) | Sheet | Deletes the row at the given row position. |
deleteRows(rowPosition, howMany) | void | Deletes a number of rows starting at the given row position. |
deleteSheet(sheet) | void | Deletes the specified sheet. |
duplicateActiveSheet() | Sheet | Duplicates the active sheet and makes it the active sheet. |
getActiveCell() | Range | Returns the active cell in this sheet. |
getActiveRange() | Range | Returns the active range for the active sheet. |
getActiveSheet() | Sheet | Gets the active sheet in a spreadsheet. |
getAs(contentType) | Blob | Return the data inside this object as a blob converted to the specified content type. |
getBlob() | Blob | Return the data inside this object as a blob. |
getColumnWidth(columnPosition) | Integer | Gets the width in pixels of the given column. |
getDataRange() | Range | Returns a Range corresponding to the dimensions in which data is present. |
getEditors() | User[] | Gets the list of editors for this Spreadsheet . |
getFormUrl() | String | Returns the url for the form attached to the spreadsheet, null if there is no form. |
getFrozenColumns() | Integer | Returns the number of frozen columns. |
getFrozenRows() | Integer | Returns the number of frozen rows. |
getId() | String | Gets a unique identifier for this spreadsheet. |
getLastColumn() | Integer | Returns the position of the last column that has content. |
getLastRow() | Integer | Returns the position of the last row that has content. |
getName() | String | Gets the name of the document. |
getNumSheets() | Integer | Returns the number of sheets in this spreadsheet. |
getOwner() | User | Returns the owner of the document. |
getProtections(type) | Protection[] | Gets an array of objects representing all protected ranges or sheets in the spreadsheet. |
getRange(a1Notation) | Range | Returns the range as specified in A1 notation or R1C1 notation. |
getRangeByName(name) | Range | Returns a named range, or null if no range with the given name is found. |
getRowHeight(rowPosition) | Integer | Gets the height in pixels of the given row. |
getSheetByName(name) | Sheet | Returns a sheet with the given name. |
getSheetId() | Integer | Returns the ID of the sheet represented by this object. |
getSheetName() | String | Returns 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() | String | Gets the spreadsheet locale. |
getSpreadsheetTimeZone() | String | Gets the time zone for the spreadsheet. |
getUrl() | String | Returns the url for the given spreadsheet. |
getViewers() | User[] | Gets the list of viewers and commenters for this Spreadsheet . |
hideColumn(column) | void | Hides the columns in the given range. |
hideRow(row) | void | Hides the rows in the given range. |
insertColumnAfter(afterPosition) | Sheet | Inserts a column after the given column position. |
insertColumnBefore(beforePosition) | Sheet | Inserts a column before the given column position. |
insertColumnsAfter(afterPosition, howMany) | Sheet | Inserts a number of columns after the given column position. |
insertColumnsBefore(beforePosition, howMany) | Sheet | Inserts a number of columns before the given column position. |
insertImage(blob, column, row) | void | Inserts a Blob as an image in the document at a given row and column. |
insertImage(blob, column, row, offsetX, offsetY) | void | Inserts a Blob as an image in the document at a given row and column, with a pixel
offset. |
insertImage(url, column, row) | void | Inserts an image in the document at a given row and column. |
insertImage(url, column, row, offsetX, offsetY) | void | Inserts an image in the document at a given row and column, with a pixel offset. |
insertRowAfter(afterPosition) | Sheet | Inserts a row after the given row position. |
insertRowBefore(beforePosition) | Sheet | Inserts a row before the given row position. |
insertRowsAfter(afterPosition, howMany) | Sheet | Inserts a number of rows after the given row position. |
insertRowsBefore(beforePosition, howMany) | Sheet | Inserts a number of rows before the given row position. |
insertSheet() | Sheet | Inserts a new sheet in the spreadsheet, with a default name. |
insertSheet(sheetIndex) | Sheet | Inserts a new sheet in the spreadsheet at the given index. |
insertSheet(sheetIndex, options) | Sheet | Inserts a new sheet in the spreadsheet at the given index and uses optional advanced arguments. |
insertSheet(options) | Sheet | Inserts a new sheet in the spreadsheet, with a default name and uses optional advanced arguments. |
insertSheet(sheetName) | Sheet | Inserts a new sheet in the spreadsheet with the given name. |
insertSheet(sheetName, sheetIndex) | Sheet | Inserts a new sheet in the spreadsheet with the given name at the given index. |
insertSheet(sheetName, sheetIndex, options) | Sheet | Inserts a new sheet in the spreadsheet with the given name at the given index and uses optional advanced arguments. |
insertSheet(sheetName, options) | Sheet | Inserts a new sheet in the spreadsheet with the given name and uses optional advanced arguments. |
moveActiveSheet(pos) | void | Moves the active sheet to the given position in the list of sheets. |
removeEditor(emailAddress) | Spreadsheet | Removes the given user from the list of editors for the Spreadsheet . |
removeEditor(user) | Spreadsheet | Removes the given user from the list of editors for the Spreadsheet . |
removeMenu(name) | void | Removes a menu that was added by addMenu(name, subMenus) . |
removeNamedRange(name) | void | Deletes a named range with the given name. |
removeViewer(emailAddress) | Spreadsheet | Removes the given user from the list of viewers and commenters for the Spreadsheet . |
removeViewer(user) | Spreadsheet | Removes the given user from the list of viewers and commenters for the Spreadsheet . |
rename(newName) | void | Renames the document. |
renameActiveSheet(newName) | void | Renames the current active sheet to the given new name. |
setActiveRange(range) | Range | Sets the active range for the active sheet. |
setActiveSelection(range) | Range | Sets the active selection region for this sheet. |
setActiveSelection(a1Notation) | Range | Sets the active selection, as specified in A1 notation or R1C1 notation. |
setActiveSheet(sheet) | Sheet | Sets the given sheet to be the active sheet in the spreadsheet. |
setColumnWidth(columnPosition, width) | Sheet | Sets the width of the given column in pixels. |
setFrozenColumns(columns) | void | Freezes the given number of columns. |
setFrozenRows(rows) | void | Freezes the given number of rows. |
setNamedRange(name, range) | void | Names a range. |
setRowHeight(rowPosition, height) | Sheet | Sets the row height of the given row in pixels. |
setSpreadsheetLocale(locale) | void | Sets the spreadsheet locale. |
setSpreadsheetTimeZone(timezone) | void | Sets the time zone for the spreadsheet. |
show(userInterface) | void | Displays a custom user interface component in a dialog centered in the user's browser's viewport. |
sort(columnPosition) | Sheet | Sorts a sheet by column, ascending. |
sort(columnPosition, ascending) | Sheet | Sorts a sheet by column. |
toast(msg) | void | Shows a popup window in the lower right corner of the spreadsheet with the given message. |
toast(msg, title) | void | Shows a popup window in the lower right corner of the spreadsheet with the given message and title. |
toast(msg, title, timeoutSeconds) | void | Shows 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) | void | Unhides the column in the given range. |
unhideRow(row) | void | Unhides the row in the given range. |
updateMenu(name, subMenus) | void | Updates a menu that was added by addMenu(name, subMenus) . |
Class SpreadsheetApp
Properties
Property | Type | Description |
---|---|---|
DataValidationCriteria | DataValidationCriteria | An enumeration representing the data-validation criteria that can be set on a range. |
ProtectionType | ProtectionType | An enumeration representing the parts of a spreadsheet that can be protected from edits. |
Methods
Method | Return type | Brief description |
---|---|---|
create(name) | Spreadsheet | Creates a new spreadsheet with the given name. |
create(name, rows, columns) | Spreadsheet | Creates a new spreadsheet with the given name and the specified number of rows and columns. |
flush() | void | Applies all pending Spreadsheet changes. |
getActive() | Spreadsheet | Returns the currently active spreadsheet, or null if there is none. |
getActiveRange() | Range | Returns the range of cells that is currently considered active. |
getActiveSheet() | Sheet | Gets the active sheet in a spreadsheet. |
getActiveSpreadsheet() | Spreadsheet | Returns the currently active spreadsheet, or null if there is none. |
getUi() | Ui | Returns an instance of the spreadsheet's user-interface environment that allows the script to add features like menus, dialogs, and sidebars. |
newDataValidation() | DataValidationBuilder | Creates a builder for a data-validation rule. |
open(file) | Spreadsheet | Opens the spreadsheet that corresponds to the given File object. |
openById(id) | Spreadsheet | Opens the spreadsheet with the given ID. |
openByUrl(url) | Spreadsheet | Opens the spreadsheet with the given url. |
setActiveRange(range) | Range | Sets the active range for the application. |
setActiveSheet(sheet) | Sheet | Sets the active sheet in a spreadsheet. |
setActiveSpreadsheet(newActiveSpreadsheet) | void | Sets the active spreadsheet. |