Create

Creates a spreadsheet, returning the newly created spreadsheet

148 variables
148 variables

Creates a spreadsheet, returning the newly created spreadsheet

Authorization

To use this building block you will have to grant access to at least one of the following scopes:

  • See, edit, create, and delete all of your Google Drive files
  • View and manage Google Drive files and folders that you have opened or created with this app
  • View and manage your spreadsheets in Google Drive

Input

This building block consumes 148 input parameters

  = Parameter name
  = Format

namedRanges[] OBJECT

A named range

namedRanges[].name STRING

The name of the named range

namedRanges[].namedRangeId STRING

The ID of the named range

namedRanges[].range OBJECT

A range on a sheet. All indexes are zero-based. Indexes are half open, e.g the start index is inclusive and the end index is exclusive -- [start_index, end_index). Missing indexes indicate the range is unbounded on that side.

For example, if "Sheet1" is sheet ID 0, then:

Sheet1!A1:A1 == sheet_id: 0, start_row_index: 0, end_row_index: 1, start_column_index: 0, end_column_index: 1

Sheet1!A3:B4 == sheet_id: 0, start_row_index: 2, end_row_index: 4, start_column_index: 0, end_column_index: 2

Sheet1!A:B == sheet_id: 0, start_column_index: 0, end_column_index: 2

Sheet1!A5:B == sheet_id: 0, start_row_index: 4, start_column_index: 0, end_column_index: 2

Sheet1 == sheet_id:0

The start index must always be less than or equal to the end index. If the start index equals the end index, then the range is empty. Empty ranges are typically not meaningful and are usually rendered in the UI as #REF!

namedRanges[].range.startRowIndex INTEGER

The start row (inclusive) of the range, or not set if unbounded

namedRanges[].range.startColumnIndex INTEGER

The start column (inclusive) of the range, or not set if unbounded

namedRanges[].range.sheetId INTEGER

The sheet this range is on

namedRanges[].range.endRowIndex INTEGER

The end row (exclusive) of the range, or not set if unbounded

namedRanges[].range.endColumnIndex INTEGER

The end column (exclusive) of the range, or not set if unbounded

spreadsheetId STRING

The ID of the spreadsheet. This field is read-only

developerMetadata[] OBJECT

Developer metadata associated with a location or object in a spreadsheet. Developer metadata may be used to associate arbitrary data with various parts of a spreadsheet and will remain associated at those locations as they move around and the spreadsheet is edited. For example, if developer metadata is associated with row 5 and another row is then subsequently inserted above row 5, that original metadata will still be associated with the row it was first associated with (what is now row 6). If the associated object is deleted its metadata is deleted too

developerMetadata[].metadataId INTEGER

The spreadsheet-scoped unique ID that identifies the metadata. IDs may be specified when metadata is created, otherwise one will be randomly generated and assigned. Must be positive

developerMetadata[].location OBJECT

A location where metadata may be associated in a spreadsheet

developerMetadata[].location.dimensionRange OBJECT

A range along a single dimension on a sheet. All indexes are zero-based. Indexes are half open: the start index is inclusive and the end index is exclusive. Missing indexes indicate the range is unbounded on that side

developerMetadata[].location.dimensionRange.startIndex INTEGER

The start (inclusive) of the span, or not set if unbounded

developerMetadata[].location.dimensionRange.endIndex INTEGER

The end (exclusive) of the span, or not set if unbounded

developerMetadata[].location.dimensionRange.sheetId INTEGER

The sheet this span is on

developerMetadata[].location.dimensionRange.dimension ENUMERATION

The dimension of the span

developerMetadata[].location.spreadsheet BOOLEAN

True when metadata is associated with an entire spreadsheet

developerMetadata[].location.sheetId INTEGER

The ID of the sheet when metadata is associated with an entire sheet

developerMetadata[].location.locationType ENUMERATION

The type of location this object represents. This field is read-only

developerMetadata[].visibility ENUMERATION

The metadata visibility. Developer metadata must always have a visibility specified

developerMetadata[].metadataValue STRING

Data associated with the metadata's key

developerMetadata[].metadataKey STRING

The metadata key. There may be multiple metadata in a spreadsheet with the same key. Developer metadata must always have a key specified

sheets[] OBJECT

A sheet in a spreadsheet

sheets[].rowGroups[] OBJECT

A group over an interval of rows or columns on a sheet, which can contain or be contained within other groups. A group can be collapsed or expanded as a unit on the sheet

sheets[].rowGroups[].collapsed BOOLEAN

This field is true if this group is collapsed. A collapsed group remains collapsed if an overlapping group at a shallower depth is expanded.

A true value does not imply that all dimensions within the group are hidden, since a dimension's visibility can change independently from this group property. However, when this property is updated, all dimensions within it are set to hidden if this field is true, or set to visible if this field is false

sheets[].rowGroups[].range OBJECT

A range along a single dimension on a sheet. All indexes are zero-based. Indexes are half open: the start index is inclusive and the end index is exclusive. Missing indexes indicate the range is unbounded on that side

sheets[].rowGroups[].depth INTEGER

The depth of the group, representing how many groups have a range that wholly contains the range of this group

sheets[].data[] OBJECT

Data in the grid, as well as metadata about the dimensions

sheets[].data[].startRow INTEGER

The first row this GridData refers to, zero-based

sheets[].data[].startColumn INTEGER

The first column this GridData refers to, zero-based

sheets[].properties OBJECT

Properties of a sheet

sheets[].properties.title STRING

The name of the sheet

sheets[].properties.tabColor OBJECT

Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness; for example, the fields of this representation can be trivially provided to the constructor of "java.awt.Color" in Java; it can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha" method in iOS; and, with just a little work, it can be easily formatted into a CSS "rgba()" string in JavaScript, as well.

Note: this proto does not carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color space.

Example (Java):

 import com.google.type.Color;

 // ...
 public static java.awt.Color fromProto(Color protocolor) {
   float alpha = protocolor.hasAlpha()
       ? protocolor.getAlpha().getValue()
       : 1.0;

   return new java.awt.Color(
       protocolor.getRed(),
       protocolor.getGreen(),
       protocolor.getBlue(),
       alpha);
 }

 public static Color toProto(java.awt.Color color) {
   float red = (float) color.getRed();
   float green = (float) color.getGreen();
   float blue = (float) color.getBlue();
   float denominator = 255.0;
   Color.Builder resultBuilder =
       Color
           .newBuilder()
           .setRed(red / denominator)
           .setGreen(green / denominator)
           .setBlue(blue / denominator);
   int alpha = color.getAlpha();
   if (alpha != 255) {
     result.setAlpha(
         FloatValue
             .newBuilder()
             .setValue(((float) alpha) / denominator)
             .build());
   }
   return resultBuilder.build();
 }
 // ...

Example (iOS / Obj-C):

 // ...
 static UIColor* fromProto(Color* protocolor) {
    float red = [protocolor red];
    float green = [protocolor green];
    float blue = [protocolor blue];
    FloatValue* alpha_wrapper = [protocolor alpha];
    float alpha = 1.0;
    if (alpha_wrapper != nil) {
      alpha = [alpha_wrapper value];
    }
    return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
 }

 static Color* toProto(UIColor* color) {
     CGFloat red, green, blue, alpha;
     if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
       return nil;
     }
     Color* result = [[Color alloc] init];
     [result setRed:red];
     [result setGreen:green];
     [result setBlue:blue];
     if (alpha <= 0.9999) {
       [result setAlpha:floatWrapperWithValue(alpha)];
     }
     [result autorelease];
     return result;
}
// ...

Example (JavaScript):

// ...

var protoToCssColor = function(rgb_color) {
   var redFrac = rgb_color.red || 0.0;
   var greenFrac = rgb_color.green || 0.0;
   var blueFrac = rgb_color.blue || 0.0;
   var red = Math.floor(redFrac * 255);
   var green = Math.floor(greenFrac * 255);
   var blue = Math.floor(blueFrac * 255);

   if (!('alpha' in rgb_color)) {
      return rgbToCssColor_(red, green, blue);
   }

   var alphaFrac = rgb_color.alpha.value || 0.0;
   var rgbParams = [red, green, blue].join(',');
   return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
};

var rgbToCssColor_ = function(red, green, blue) {
  var rgbNumber = new Number((red << 16) | (green << 8) | blue);
  var hexString = rgbNumber.toString(16);
  var missingZeros = 6 - hexString.length;
  var resultBuilder = ['#'];
  for (var i = 0; i < missingZeros; i++) {
     resultBuilder.push('0');
  }
  resultBuilder.push(hexString);
  return resultBuilder.join('');
};

// ...

sheets[].properties.tabColor.green FLOAT

The amount of green in the color as a value in the interval [0, 1]

sheets[].properties.tabColor.blue FLOAT

The amount of blue in the color as a value in the interval [0, 1]

sheets[].properties.tabColor.alpha FLOAT

The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation:

pixel color = alpha * (this color) + (1.0 - alpha) * (background color)

This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is to be rendered as a solid color (as if the alpha value had been explicitly given with a value of 1.0)

sheets[].properties.tabColor.red FLOAT

The amount of red in the color as a value in the interval [0, 1]

sheets[].properties.index INTEGER

The index of the sheet within the spreadsheet. When adding or updating sheet properties, if this field is excluded then the sheet is added or moved to the end of the sheet list. When updating sheet indices or inserting sheets, movement is considered in "before the move" indexes. For example, if there were 3 sheets (S1, S2, S3) in order to move S1 ahead of S2 the index would have to be set to 2. A sheet index update request is ignored if the requested index is identical to the sheets current index or if the requested new index is equal to the current sheet index + 1

sheets[].properties.sheetId INTEGER

The ID of the sheet. Must be non-negative. This field cannot be changed once set

sheets[].properties.rightToLeft BOOLEAN

True if the sheet is an RTL sheet instead of an LTR sheet

sheets[].properties.hidden BOOLEAN

True if the sheet is hidden in the UI, false if it's visible

sheets[].properties.gridProperties OBJECT

Properties of a grid

sheets[].properties.gridProperties.rowCount INTEGER

The number of rows in the grid

sheets[].properties.gridProperties.hideGridlines BOOLEAN

True if the grid isn't showing gridlines in the UI

sheets[].properties.gridProperties.frozenRowCount INTEGER

The number of rows that are frozen in the grid

sheets[].properties.gridProperties.columnCount INTEGER

The number of columns in the grid

sheets[].properties.gridProperties.frozenColumnCount INTEGER

The number of columns that are frozen in the grid

sheets[].properties.gridProperties.columnGroupControlAfter BOOLEAN

True if the column grouping control toggle is shown after the group

sheets[].properties.gridProperties.rowGroupControlAfter BOOLEAN

True if the row grouping control toggle is shown after the group

sheets[].properties.sheetType ENUMERATION

The type of sheet. Defaults to GRID. This field cannot be changed once set

sheets[].columnGroups[] OBJECT

A group over an interval of rows or columns on a sheet, which can contain or be contained within other groups. A group can be collapsed or expanded as a unit on the sheet

sheets[].columnGroups[].collapsed BOOLEAN

This field is true if this group is collapsed. A collapsed group remains collapsed if an overlapping group at a shallower depth is expanded.

A true value does not imply that all dimensions within the group are hidden, since a dimension's visibility can change independently from this group property. However, when this property is updated, all dimensions within it are set to hidden if this field is true, or set to visible if this field is false

sheets[].columnGroups[].range OBJECT

A range along a single dimension on a sheet. All indexes are zero-based. Indexes are half open: the start index is inclusive and the end index is exclusive. Missing indexes indicate the range is unbounded on that side

sheets[].columnGroups[].depth INTEGER

The depth of the group, representing how many groups have a range that wholly contains the range of this group

sheets[].conditionalFormats[] OBJECT

A rule describing a conditional format

sheets[].conditionalFormats[].gradientRule OBJECT

A rule that applies a gradient color scale format, based on the interpolation points listed. The format of a cell will vary based on its contents as compared to the values of the interpolation points

sheets[].conditionalFormats[].booleanRule OBJECT

A rule that may or may not match, depending on the condition

sheets[].protectedRanges[] OBJECT

A protected range

sheets[].protectedRanges[].editors OBJECT

The editors of a protected range

sheets[].protectedRanges[].range OBJECT

A range on a sheet. All indexes are zero-based. Indexes are half open, e.g the start index is inclusive and the end index is exclusive -- [start_index, end_index). Missing indexes indicate the range is unbounded on that side.

For example, if "Sheet1" is sheet ID 0, then:

Sheet1!A1:A1 == sheet_id: 0, start_row_index: 0, end_row_index: 1, start_column_index: 0, end_column_index: 1

Sheet1!A3:B4 == sheet_id: 0, start_row_index: 2, end_row_index: 4, start_column_index: 0, end_column_index: 2

Sheet1!A:B == sheet_id: 0, start_column_index: 0, end_column_index: 2

Sheet1!A5:B == sheet_id: 0, start_row_index: 4, start_column_index: 0, end_column_index: 2

Sheet1 == sheet_id:0

The start index must always be less than or equal to the end index. If the start index equals the end index, then the range is empty. Empty ranges are typically not meaningful and are usually rendered in the UI as #REF!

sheets[].protectedRanges[].description STRING

The description of this protected range

sheets[].protectedRanges[].namedRangeId STRING

The named range this protected range is backed by, if any.

When writing, only one of range or named_range_id may be set

sheets[].protectedRanges[].protectedRangeId INTEGER

The ID of the protected range. This field is read-only

sheets[].protectedRanges[].warningOnly BOOLEAN

True if this protected range will show a warning when editing. Warning-based protection means that every user can edit data in the protected range, except editing will prompt a warning asking the user to confirm the edit.

When writing: if this field is true, then editors is ignored. Additionally, if this field is changed from true to false and the editors field is not set (nor included in the field mask), then the editors will be set to all the editors in the document

sheets[].protectedRanges[].requestingUserCanEdit BOOLEAN

True if the user who requested this protected range can edit the protected area. This field is read-only

sheets[].developerMetadata[] OBJECT

Developer metadata associated with a location or object in a spreadsheet. Developer metadata may be used to associate arbitrary data with various parts of a spreadsheet and will remain associated at those locations as they move around and the spreadsheet is edited. For example, if developer metadata is associated with row 5 and another row is then subsequently inserted above row 5, that original metadata will still be associated with the row it was first associated with (what is now row 6). If the associated object is deleted its metadata is deleted too

sheets[].developerMetadata[].metadataId INTEGER

The spreadsheet-scoped unique ID that identifies the metadata. IDs may be specified when metadata is created, otherwise one will be randomly generated and assigned. Must be positive

sheets[].developerMetadata[].location OBJECT

A location where metadata may be associated in a spreadsheet

sheets[].developerMetadata[].visibility ENUMERATION

The metadata visibility. Developer metadata must always have a visibility specified

sheets[].developerMetadata[].metadataValue STRING

Data associated with the metadata's key

sheets[].developerMetadata[].metadataKey STRING

The metadata key. There may be multiple metadata in a spreadsheet with the same key. Developer metadata must always have a key specified

sheets[].basicFilter OBJECT

The default filter associated with a sheet

sheets[].basicFilter.sortSpecs[] OBJECT

A sort order associated with a specific column or row

sheets[].basicFilter.range OBJECT

A range on a sheet. All indexes are zero-based. Indexes are half open, e.g the start index is inclusive and the end index is exclusive -- [start_index, end_index). Missing indexes indicate the range is unbounded on that side.

For example, if "Sheet1" is sheet ID 0, then:

Sheet1!A1:A1 == sheet_id: 0, start_row_index: 0, end_row_index: 1, start_column_index: 0, end_column_index: 1

Sheet1!A3:B4 == sheet_id: 0, start_row_index: 2, end_row_index: 4, start_column_index: 0, end_column_index: 2

Sheet1!A:B == sheet_id: 0, start_column_index: 0, end_column_index: 2

Sheet1!A5:B == sheet_id: 0, start_row_index: 4, start_column_index: 0, end_column_index: 2

Sheet1 == sheet_id:0

The start index must always be less than or equal to the end index. If the start index equals the end index, then the range is empty. Empty ranges are typically not meaningful and are usually rendered in the UI as #REF!

sheets[].basicFilter.range.startRowIndex INTEGER

The start row (inclusive) of the range, or not set if unbounded

sheets[].basicFilter.range.startColumnIndex INTEGER

The start column (inclusive) of the range, or not set if unbounded

sheets[].basicFilter.range.sheetId INTEGER

The sheet this range is on

sheets[].basicFilter.range.endRowIndex INTEGER

The end row (exclusive) of the range, or not set if unbounded

sheets[].basicFilter.range.endColumnIndex INTEGER

The end column (exclusive) of the range, or not set if unbounded

sheets[].basicFilter.criteria OBJECT

The criteria for showing/hiding values per column. The map's key is the column index, and the value is the criteria for that column

sheets[].basicFilter.criteria.customKey OBJECT

Add additional named properties

sheets[].merges[] OBJECT

A range on a sheet. All indexes are zero-based. Indexes are half open, e.g the start index is inclusive and the end index is exclusive -- [start_index, end_index). Missing indexes indicate the range is unbounded on that side.

For example, if "Sheet1" is sheet ID 0, then:

Sheet1!A1:A1 == sheet_id: 0, start_row_index: 0, end_row_index: 1, start_column_index: 0, end_column_index: 1

Sheet1!A3:B4 == sheet_id: 0, start_row_index: 2, end_row_index: 4, start_column_index: 0, end_column_index: 2

Sheet1!A:B == sheet_id: 0, start_column_index: 0, end_column_index: 2

Sheet1!A5:B == sheet_id: 0, start_row_index: 4, start_column_index: 0, end_column_index: 2

Sheet1 == sheet_id:0

The start index must always be less than or equal to the end index. If the start index equals the end index, then the range is empty. Empty ranges are typically not meaningful and are usually rendered in the UI as #REF!

sheets[].merges[].startRowIndex INTEGER

The start row (inclusive) of the range, or not set if unbounded

sheets[].merges[].startColumnIndex INTEGER

The start column (inclusive) of the range, or not set if unbounded

sheets[].merges[].sheetId INTEGER

The sheet this range is on

sheets[].merges[].endRowIndex INTEGER

The end row (exclusive) of the range, or not set if unbounded

sheets[].merges[].endColumnIndex INTEGER

The end column (exclusive) of the range, or not set if unbounded

sheets[].bandedRanges[] OBJECT

A banded (alternating colors) range in a sheet

sheets[].bandedRanges[].bandedRangeId INTEGER

The id of the banded range

sheets[].bandedRanges[].rowProperties OBJECT

Properties referring a single dimension (either row or column). If both BandedRange.row_properties and BandedRange.column_properties are set, the fill colors are applied to cells according to the following rules:

  • header_color and footer_color take priority over band colors.
  • first_band_color takes priority over second_band_color.
  • row_properties takes priority over column_properties.

For example, the first row color takes priority over the first column color, but the first column color takes priority over the second row color. Similarly, the row header takes priority over the column header in the top left cell, but the column header takes priority over the first row color if the row header is not set

sheets[].bandedRanges[].columnProperties OBJECT

Properties referring a single dimension (either row or column). If both BandedRange.row_properties and BandedRange.column_properties are set, the fill colors are applied to cells according to the following rules:

  • header_color and footer_color take priority over band colors.
  • first_band_color takes priority over second_band_color.
  • row_properties takes priority over column_properties.

For example, the first row color takes priority over the first column color, but the first column color takes priority over the second row color. Similarly, the row header takes priority over the column header in the top left cell, but the column header takes priority over the first row color if the row header is not set

sheets[].bandedRanges[].range OBJECT

A range on a sheet. All indexes are zero-based. Indexes are half open, e.g the start index is inclusive and the end index is exclusive -- [start_index, end_index). Missing indexes indicate the range is unbounded on that side.

For example, if "Sheet1" is sheet ID 0, then:

Sheet1!A1:A1 == sheet_id: 0, start_row_index: 0, end_row_index: 1, start_column_index: 0, end_column_index: 1

Sheet1!A3:B4 == sheet_id: 0, start_row_index: 2, end_row_index: 4, start_column_index: 0, end_column_index: 2

Sheet1!A:B == sheet_id: 0, start_column_index: 0, end_column_index: 2

Sheet1!A5:B == sheet_id: 0, start_row_index: 4, start_column_index: 0, end_column_index: 2

Sheet1 == sheet_id:0

The start index must always be less than or equal to the end index. If the start index equals the end index, then the range is empty. Empty ranges are typically not meaningful and are usually rendered in the UI as #REF!

sheets[].charts[] OBJECT

A chart embedded in a sheet

sheets[].charts[].chartId INTEGER

The ID of the chart

sheets[].charts[].position OBJECT

The position of an embedded object such as a chart

sheets[].charts[].spec OBJECT

The specifications of a chart

sheets[].filterViews[] OBJECT

A filter view

sheets[].filterViews[].namedRangeId STRING

The named range this filter view is backed by, if any.

When writing, only one of range or named_range_id may be set

sheets[].filterViews[].filterViewId INTEGER

The ID of the filter view

sheets[].filterViews[].criteria OBJECT

The criteria for showing/hiding values per column. The map's key is the column index, and the value is the criteria for that column

sheets[].filterViews[].title STRING

The name of the filter view

sheets[].filterViews[].range OBJECT

A range on a sheet. All indexes are zero-based. Indexes are half open, e.g the start index is inclusive and the end index is exclusive -- [start_index, end_index). Missing indexes indicate the range is unbounded on that side.

For example, if "Sheet1" is sheet ID 0, then:

Sheet1!A1:A1 == sheet_id: 0, start_row_index: 0, end_row_index: 1, start_column_index: 0, end_column_index: 1

Sheet1!A3:B4 == sheet_id: 0, start_row_index: 2, end_row_index: 4, start_column_index: 0, end_column_index: 2

Sheet1!A:B == sheet_id: 0, start_column_index: 0, end_column_index: 2

Sheet1!A5:B == sheet_id: 0, start_row_index: 4, start_column_index: 0, end_column_index: 2

Sheet1 == sheet_id:0

The start index must always be less than or equal to the end index. If the start index equals the end index, then the range is empty. Empty ranges are typically not meaningful and are usually rendered in the UI as #REF!

spreadsheetUrl STRING

The url of the spreadsheet. This field is read-only

properties OBJECT

Properties of a spreadsheet

properties.locale STRING

The locale of the spreadsheet in one of the following formats:

  • an ISO 639-1 language code such as en

  • an ISO 639-2 language code such as fil, if no 639-1 code exists

  • a combination of the ISO language code and country code, such as en_US

Note: when updating this field, not all locales/languages are supported

properties.iterativeCalculationSettings OBJECT

Settings to control how circular dependencies are resolved with iterative calculation

properties.iterativeCalculationSettings.maxIterations INTEGER

When iterative calculation is enabled, the maximum number of calculation rounds to perform

properties.iterativeCalculationSettings.convergenceThreshold NUMBER

When iterative calculation is enabled and successive results differ by less than this threshold value, the calculation rounds stop

properties.autoRecalc ENUMERATION

The amount of time to wait before volatile functions are recalculated

properties.defaultFormat OBJECT

The format of a cell

properties.defaultFormat.numberFormat OBJECT

The number format of a cell

properties.defaultFormat.numberFormat.type ENUMERATION

The type of the number format. When writing, this field must be set

properties.defaultFormat.numberFormat.pattern STRING

Pattern string used for formatting. If not set, a default pattern based on the user's locale will be used if necessary for the given type. See the Date and Number Formats guide for more information about the supported patterns

properties.defaultFormat.hyperlinkDisplayType ENUMERATION

How a hyperlink, if it exists, should be displayed in the cell

properties.defaultFormat.horizontalAlignment ENUMERATION

The horizontal alignment of the value in the cell

properties.defaultFormat.textFormat OBJECT

The format of a run of text in a cell. Absent values indicate that the field isn't specified

properties.defaultFormat.textFormat.fontFamily STRING

The font family

properties.defaultFormat.textFormat.strikethrough BOOLEAN

True if the text has a strikethrough

properties.defaultFormat.textFormat.italic BOOLEAN

True if the text is italicized

properties.defaultFormat.textFormat.fontSize INTEGER

The size of the font

properties.defaultFormat.textFormat.underline BOOLEAN

True if the text is underlined

properties.defaultFormat.textFormat.bold BOOLEAN

True if the text is bold

properties.defaultFormat.textFormat.foregroundColor OBJECT

Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness; for example, the fields of this representation can be trivially provided to the constructor of "java.awt.Color" in Java; it can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha" method in iOS; and, with just a little work, it can be easily formatted into a CSS "rgba()" string in JavaScript, as well.

Note: this proto does not carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color space.

Example (Java):

 import com.google.type.Color;

 // ...
 public static java.awt.Color fromProto(Color protocolor) {
   float alpha = protocolor.hasAlpha()
       ? protocolor.getAlpha().getValue()
       : 1.0;

   return new java.awt.Color(
       protocolor.getRed(),
       protocolor.getGreen(),
       protocolor.getBlue(),
       alpha);
 }

 public static Color toProto(java.awt.Color color) {
   float red = (float) color.getRed();
   float green = (float) color.getGreen();
   float blue = (float) color.getBlue();
   float denominator = 255.0;
   Color.Builder resultBuilder =
       Color
           .newBuilder()
           .setRed(red / denominator)
           .setGreen(green / denominator)
           .setBlue(blue / denominator);
   int alpha = color.getAlpha();
   if (alpha != 255) {
     result.setAlpha(
         FloatValue
             .newBuilder()
             .setValue(((float) alpha) / denominator)
             .build());
   }
   return resultBuilder.build();
 }
 // ...

Example (iOS / Obj-C):

 // ...
 static UIColor* fromProto(Color* protocolor) {
    float red = [protocolor red];
    float green = [protocolor green];
    float blue = [protocolor blue];
    FloatValue* alpha_wrapper = [protocolor alpha];
    float alpha = 1.0;
    if (alpha_wrapper != nil) {
      alpha = [alpha_wrapper value];
    }
    return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
 }

 static Color* toProto(UIColor* color) {
     CGFloat red, green, blue, alpha;
     if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
       return nil;
     }
     Color* result = [[Color alloc] init];
     [result setRed:red];
     [result setGreen:green];
     [result setBlue:blue];
     if (alpha <= 0.9999) {
       [result setAlpha:floatWrapperWithValue(alpha)];
     }
     [result autorelease];
     return result;
}
// ...

Example (JavaScript):

// ...

var protoToCssColor = function(rgb_color) {
   var redFrac = rgb_color.red || 0.0;
   var greenFrac = rgb_color.green || 0.0;
   var blueFrac = rgb_color.blue || 0.0;
   var red = Math.floor(redFrac * 255);
   var green = Math.floor(greenFrac * 255);
   var blue = Math.floor(blueFrac * 255);

   if (!('alpha' in rgb_color)) {
      return rgbToCssColor_(red, green, blue);
   }

   var alphaFrac = rgb_color.alpha.value || 0.0;
   var rgbParams = [red, green, blue].join(',');
   return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
};

var rgbToCssColor_ = function(red, green, blue) {
  var rgbNumber = new Number((red << 16) | (green << 8) | blue);
  var hexString = rgbNumber.toString(16);
  var missingZeros = 6 - hexString.length;
  var resultBuilder = ['#'];
  for (var i = 0; i < missingZeros; i++) {
     resultBuilder.push('0');
  }
  resultBuilder.push(hexString);
  return resultBuilder.join('');
};

// ...

properties.defaultFormat.backgroundColor OBJECT

Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness; for example, the fields of this representation can be trivially provided to the constructor of "java.awt.Color" in Java; it can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha" method in iOS; and, with just a little work, it can be easily formatted into a CSS "rgba()" string in JavaScript, as well.

Note: this proto does not carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color space.

Example (Java):

 import com.google.type.Color;

 // ...
 public static java.awt.Color fromProto(Color protocolor) {
   float alpha = protocolor.hasAlpha()
       ? protocolor.getAlpha().getValue()
       : 1.0;

   return new java.awt.Color(
       protocolor.getRed(),
       protocolor.getGreen(),
       protocolor.getBlue(),
       alpha);
 }

 public static Color toProto(java.awt.Color color) {
   float red = (float) color.getRed();
   float green = (float) color.getGreen();
   float blue = (float) color.getBlue();
   float denominator = 255.0;
   Color.Builder resultBuilder =
       Color
           .newBuilder()
           .setRed(red / denominator)
           .setGreen(green / denominator)
           .setBlue(blue / denominator);
   int alpha = color.getAlpha();
   if (alpha != 255) {
     result.setAlpha(
         FloatValue
             .newBuilder()
             .setValue(((float) alpha) / denominator)
             .build());
   }
   return resultBuilder.build();
 }
 // ...

Example (iOS / Obj-C):

 // ...
 static UIColor* fromProto(Color* protocolor) {
    float red = [protocolor red];
    float green = [protocolor green];
    float blue = [protocolor blue];
    FloatValue* alpha_wrapper = [protocolor alpha];
    float alpha = 1.0;
    if (alpha_wrapper != nil) {
      alpha = [alpha_wrapper value];
    }
    return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
 }

 static Color* toProto(UIColor* color) {
     CGFloat red, green, blue, alpha;
     if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
       return nil;
     }
     Color* result = [[Color alloc] init];
     [result setRed:red];
     [result setGreen:green];
     [result setBlue:blue];
     if (alpha <= 0.9999) {
       [result setAlpha:floatWrapperWithValue(alpha)];
     }
     [result autorelease];
     return result;
}
// ...

Example (JavaScript):

// ...

var protoToCssColor = function(rgb_color) {
   var redFrac = rgb_color.red || 0.0;
   var greenFrac = rgb_color.green || 0.0;
   var blueFrac = rgb_color.blue || 0.0;
   var red = Math.floor(redFrac * 255);
   var green = Math.floor(greenFrac * 255);
   var blue = Math.floor(blueFrac * 255);

   if (!('alpha' in rgb_color)) {
      return rgbToCssColor_(red, green, blue);
   }

   var alphaFrac = rgb_color.alpha.value || 0.0;
   var rgbParams = [red, green, blue].join(',');
   return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
};

var rgbToCssColor_ = function(red, green, blue) {
  var rgbNumber = new Number((red << 16) | (green << 8) | blue);
  var hexString = rgbNumber.toString(16);
  var missingZeros = 6 - hexString.length;
  var resultBuilder = ['#'];
  for (var i = 0; i < missingZeros; i++) {
     resultBuilder.push('0');
  }
  resultBuilder.push(hexString);
  return resultBuilder.join('');
};

// ...

properties.defaultFormat.backgroundColor.green FLOAT

The amount of green in the color as a value in the interval [0, 1]

properties.defaultFormat.backgroundColor.blue FLOAT

The amount of blue in the color as a value in the interval [0, 1]

properties.defaultFormat.backgroundColor.alpha FLOAT

The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation:

pixel color = alpha * (this color) + (1.0 - alpha) * (background color)

This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is to be rendered as a solid color (as if the alpha value had been explicitly given with a value of 1.0)

properties.defaultFormat.backgroundColor.red FLOAT

The amount of red in the color as a value in the interval [0, 1]

properties.defaultFormat.padding OBJECT

The amount of padding around the cell, in pixels. When updating padding, every field must be specified

properties.defaultFormat.padding.top INTEGER

The top padding of the cell

properties.defaultFormat.padding.left INTEGER

The left padding of the cell

properties.defaultFormat.padding.right INTEGER

The right padding of the cell

properties.defaultFormat.padding.bottom INTEGER

The bottom padding of the cell

properties.defaultFormat.verticalAlignment ENUMERATION

The vertical alignment of the value in the cell

properties.defaultFormat.borders OBJECT

The borders of the cell

properties.defaultFormat.borders.left OBJECT

A border along a cell

properties.defaultFormat.borders.right OBJECT

A border along a cell

properties.defaultFormat.borders.bottom OBJECT

A border along a cell

properties.defaultFormat.borders.top OBJECT

A border along a cell

properties.defaultFormat.textDirection ENUMERATION

The direction of the text in the cell

properties.defaultFormat.wrapStrategy ENUMERATION

The wrap strategy for the value in the cell

properties.defaultFormat.textRotation OBJECT

The rotation applied to text in a cell

properties.defaultFormat.textRotation.angle INTEGER

The angle between the standard orientation and the desired orientation. Measured in degrees. Valid values are between -90 and 90. Positive angles are angled upwards, negative are angled downwards.

Note: For LTR text direction positive angles are in the counterclockwise direction, whereas for RTL they are in the clockwise direction

properties.defaultFormat.textRotation.vertical BOOLEAN

If true, text reads top to bottom, but the orientation of individual characters is unchanged. For example:

| V |
| e |
| r |
| t |
| i |
| c |
| a |
| l |

properties.title STRING

The title of the spreadsheet

properties.timeZone STRING

The time zone of the spreadsheet, in CLDR format such as America/New_York. If the time zone isn't recognized, this may be a custom time zone such as GMT-07:00

Output

This building block provides 148 output parameters

  = Parameter name
  = Format

namedRanges[] OBJECT

A named range

namedRanges[].name STRING

The name of the named range

namedRanges[].namedRangeId STRING

The ID of the named range

namedRanges[].range OBJECT

A range on a sheet. All indexes are zero-based. Indexes are half open, e.g the start index is inclusive and the end index is exclusive -- [start_index, end_index). Missing indexes indicate the range is unbounded on that side.

For example, if "Sheet1" is sheet ID 0, then:

Sheet1!A1:A1 == sheet_id: 0, start_row_index: 0, end_row_index: 1, start_column_index: 0, end_column_index: 1

Sheet1!A3:B4 == sheet_id: 0, start_row_index: 2, end_row_index: 4, start_column_index: 0, end_column_index: 2

Sheet1!A:B == sheet_id: 0, start_column_index: 0, end_column_index: 2

Sheet1!A5:B == sheet_id: 0, start_row_index: 4, start_column_index: 0, end_column_index: 2

Sheet1 == sheet_id:0

The start index must always be less than or equal to the end index. If the start index equals the end index, then the range is empty. Empty ranges are typically not meaningful and are usually rendered in the UI as #REF!

namedRanges[].range.startRowIndex INTEGER

The start row (inclusive) of the range, or not set if unbounded

namedRanges[].range.startColumnIndex INTEGER

The start column (inclusive) of the range, or not set if unbounded

namedRanges[].range.sheetId INTEGER

The sheet this range is on

namedRanges[].range.endRowIndex INTEGER

The end row (exclusive) of the range, or not set if unbounded

namedRanges[].range.endColumnIndex INTEGER

The end column (exclusive) of the range, or not set if unbounded

spreadsheetId STRING

The ID of the spreadsheet. This field is read-only

developerMetadata[] OBJECT

Developer metadata associated with a location or object in a spreadsheet. Developer metadata may be used to associate arbitrary data with various parts of a spreadsheet and will remain associated at those locations as they move around and the spreadsheet is edited. For example, if developer metadata is associated with row 5 and another row is then subsequently inserted above row 5, that original metadata will still be associated with the row it was first associated with (what is now row 6). If the associated object is deleted its metadata is deleted too

developerMetadata[].metadataId INTEGER

The spreadsheet-scoped unique ID that identifies the metadata. IDs may be specified when metadata is created, otherwise one will be randomly generated and assigned. Must be positive

developerMetadata[].location OBJECT

A location where metadata may be associated in a spreadsheet

developerMetadata[].location.dimensionRange OBJECT

A range along a single dimension on a sheet. All indexes are zero-based. Indexes are half open: the start index is inclusive and the end index is exclusive. Missing indexes indicate the range is unbounded on that side

developerMetadata[].location.dimensionRange.startIndex INTEGER

The start (inclusive) of the span, or not set if unbounded

developerMetadata[].location.dimensionRange.endIndex INTEGER

The end (exclusive) of the span, or not set if unbounded

developerMetadata[].location.dimensionRange.sheetId INTEGER

The sheet this span is on

developerMetadata[].location.dimensionRange.dimension ENUMERATION

The dimension of the span

developerMetadata[].location.spreadsheet BOOLEAN

True when metadata is associated with an entire spreadsheet

developerMetadata[].location.sheetId INTEGER

The ID of the sheet when metadata is associated with an entire sheet

developerMetadata[].location.locationType ENUMERATION

The type of location this object represents. This field is read-only

developerMetadata[].visibility ENUMERATION

The metadata visibility. Developer metadata must always have a visibility specified

developerMetadata[].metadataValue STRING

Data associated with the metadata's key

developerMetadata[].metadataKey STRING

The metadata key. There may be multiple metadata in a spreadsheet with the same key. Developer metadata must always have a key specified

sheets[] OBJECT

A sheet in a spreadsheet

sheets[].rowGroups[] OBJECT

A group over an interval of rows or columns on a sheet, which can contain or be contained within other groups. A group can be collapsed or expanded as a unit on the sheet

sheets[].rowGroups[].collapsed BOOLEAN

This field is true if this group is collapsed. A collapsed group remains collapsed if an overlapping group at a shallower depth is expanded.

A true value does not imply that all dimensions within the group are hidden, since a dimension's visibility can change independently from this group property. However, when this property is updated, all dimensions within it are set to hidden if this field is true, or set to visible if this field is false

sheets[].rowGroups[].range OBJECT

A range along a single dimension on a sheet. All indexes are zero-based. Indexes are half open: the start index is inclusive and the end index is exclusive. Missing indexes indicate the range is unbounded on that side

sheets[].rowGroups[].depth INTEGER

The depth of the group, representing how many groups have a range that wholly contains the range of this group

sheets[].data[] OBJECT

Data in the grid, as well as metadata about the dimensions

sheets[].data[].startRow INTEGER

The first row this GridData refers to, zero-based

sheets[].data[].startColumn INTEGER

The first column this GridData refers to, zero-based

sheets[].properties OBJECT

Properties of a sheet

sheets[].properties.title STRING

The name of the sheet

sheets[].properties.tabColor OBJECT

Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness; for example, the fields of this representation can be trivially provided to the constructor of "java.awt.Color" in Java; it can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha" method in iOS; and, with just a little work, it can be easily formatted into a CSS "rgba()" string in JavaScript, as well.

Note: this proto does not carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color space.

Example (Java):

 import com.google.type.Color;

 // ...
 public static java.awt.Color fromProto(Color protocolor) {
   float alpha = protocolor.hasAlpha()
       ? protocolor.getAlpha().getValue()
       : 1.0;

   return new java.awt.Color(
       protocolor.getRed(),
       protocolor.getGreen(),
       protocolor.getBlue(),
       alpha);
 }

 public static Color toProto(java.awt.Color color) {
   float red = (float) color.getRed();
   float green = (float) color.getGreen();
   float blue = (float) color.getBlue();
   float denominator = 255.0;
   Color.Builder resultBuilder =
       Color
           .newBuilder()
           .setRed(red / denominator)
           .setGreen(green / denominator)
           .setBlue(blue / denominator);
   int alpha = color.getAlpha();
   if (alpha != 255) {
     result.setAlpha(
         FloatValue
             .newBuilder()
             .setValue(((float) alpha) / denominator)
             .build());
   }
   return resultBuilder.build();
 }
 // ...

Example (iOS / Obj-C):

 // ...
 static UIColor* fromProto(Color* protocolor) {
    float red = [protocolor red];
    float green = [protocolor green];
    float blue = [protocolor blue];
    FloatValue* alpha_wrapper = [protocolor alpha];
    float alpha = 1.0;
    if (alpha_wrapper != nil) {
      alpha = [alpha_wrapper value];
    }
    return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
 }

 static Color* toProto(UIColor* color) {
     CGFloat red, green, blue, alpha;
     if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
       return nil;
     }
     Color* result = [[Color alloc] init];
     [result setRed:red];
     [result setGreen:green];
     [result setBlue:blue];
     if (alpha <= 0.9999) {
       [result setAlpha:floatWrapperWithValue(alpha)];
     }
     [result autorelease];
     return result;
}
// ...

Example (JavaScript):

// ...

var protoToCssColor = function(rgb_color) {
   var redFrac = rgb_color.red || 0.0;
   var greenFrac = rgb_color.green || 0.0;
   var blueFrac = rgb_color.blue || 0.0;
   var red = Math.floor(redFrac * 255);
   var green = Math.floor(greenFrac * 255);
   var blue = Math.floor(blueFrac * 255);

   if (!('alpha' in rgb_color)) {
      return rgbToCssColor_(red, green, blue);
   }

   var alphaFrac = rgb_color.alpha.value || 0.0;
   var rgbParams = [red, green, blue].join(',');
   return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
};

var rgbToCssColor_ = function(red, green, blue) {
  var rgbNumber = new Number((red << 16) | (green << 8) | blue);
  var hexString = rgbNumber.toString(16);
  var missingZeros = 6 - hexString.length;
  var resultBuilder = ['#'];
  for (var i = 0; i < missingZeros; i++) {
     resultBuilder.push('0');
  }
  resultBuilder.push(hexString);
  return resultBuilder.join('');
};

// ...

sheets[].properties.tabColor.green FLOAT

The amount of green in the color as a value in the interval [0, 1]

sheets[].properties.tabColor.blue FLOAT

The amount of blue in the color as a value in the interval [0, 1]

sheets[].properties.tabColor.alpha FLOAT

The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation:

pixel color = alpha * (this color) + (1.0 - alpha) * (background color)

This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is to be rendered as a solid color (as if the alpha value had been explicitly given with a value of 1.0)

sheets[].properties.tabColor.red FLOAT

The amount of red in the color as a value in the interval [0, 1]

sheets[].properties.index INTEGER

The index of the sheet within the spreadsheet. When adding or updating sheet properties, if this field is excluded then the sheet is added or moved to the end of the sheet list. When updating sheet indices or inserting sheets, movement is considered in "before the move" indexes. For example, if there were 3 sheets (S1, S2, S3) in order to move S1 ahead of S2 the index would have to be set to 2. A sheet index update request is ignored if the requested index is identical to the sheets current index or if the requested new index is equal to the current sheet index + 1

sheets[].properties.sheetId INTEGER

The ID of the sheet. Must be non-negative. This field cannot be changed once set

sheets[].properties.rightToLeft BOOLEAN

True if the sheet is an RTL sheet instead of an LTR sheet

sheets[].properties.hidden BOOLEAN

True if the sheet is hidden in the UI, false if it's visible

sheets[].properties.gridProperties OBJECT

Properties of a grid

sheets[].properties.gridProperties.rowCount INTEGER

The number of rows in the grid

sheets[].properties.gridProperties.hideGridlines BOOLEAN

True if the grid isn't showing gridlines in the UI

sheets[].properties.gridProperties.frozenRowCount INTEGER

The number of rows that are frozen in the grid

sheets[].properties.gridProperties.columnCount INTEGER

The number of columns in the grid

sheets[].properties.gridProperties.frozenColumnCount INTEGER

The number of columns that are frozen in the grid

sheets[].properties.gridProperties.columnGroupControlAfter BOOLEAN

True if the column grouping control toggle is shown after the group

sheets[].properties.gridProperties.rowGroupControlAfter BOOLEAN

True if the row grouping control toggle is shown after the group

sheets[].properties.sheetType ENUMERATION

The type of sheet. Defaults to GRID. This field cannot be changed once set

sheets[].columnGroups[] OBJECT

A group over an interval of rows or columns on a sheet, which can contain or be contained within other groups. A group can be collapsed or expanded as a unit on the sheet

sheets[].columnGroups[].collapsed BOOLEAN

This field is true if this group is collapsed. A collapsed group remains collapsed if an overlapping group at a shallower depth is expanded.

A true value does not imply that all dimensions within the group are hidden, since a dimension's visibility can change independently from this group property. However, when this property is updated, all dimensions within it are set to hidden if this field is true, or set to visible if this field is false

sheets[].columnGroups[].range OBJECT

A range along a single dimension on a sheet. All indexes are zero-based. Indexes are half open: the start index is inclusive and the end index is exclusive. Missing indexes indicate the range is unbounded on that side

sheets[].columnGroups[].depth INTEGER

The depth of the group, representing how many groups have a range that wholly contains the range of this group

sheets[].conditionalFormats[] OBJECT

A rule describing a conditional format

sheets[].conditionalFormats[].gradientRule OBJECT

A rule that applies a gradient color scale format, based on the interpolation points listed. The format of a cell will vary based on its contents as compared to the values of the interpolation points

sheets[].conditionalFormats[].booleanRule OBJECT

A rule that may or may not match, depending on the condition

sheets[].protectedRanges[] OBJECT

A protected range

sheets[].protectedRanges[].editors OBJECT

The editors of a protected range

sheets[].protectedRanges[].range OBJECT

A range on a sheet. All indexes are zero-based. Indexes are half open, e.g the start index is inclusive and the end index is exclusive -- [start_index, end_index). Missing indexes indicate the range is unbounded on that side.

For example, if "Sheet1" is sheet ID 0, then:

Sheet1!A1:A1 == sheet_id: 0, start_row_index: 0, end_row_index: 1, start_column_index: 0, end_column_index: 1

Sheet1!A3:B4 == sheet_id: 0, start_row_index: 2, end_row_index: 4, start_column_index: 0, end_column_index: 2

Sheet1!A:B == sheet_id: 0, start_column_index: 0, end_column_index: 2

Sheet1!A5:B == sheet_id: 0, start_row_index: 4, start_column_index: 0, end_column_index: 2

Sheet1 == sheet_id:0

The start index must always be less than or equal to the end index. If the start index equals the end index, then the range is empty. Empty ranges are typically not meaningful and are usually rendered in the UI as #REF!

sheets[].protectedRanges[].description STRING

The description of this protected range

sheets[].protectedRanges[].namedRangeId STRING

The named range this protected range is backed by, if any.

When writing, only one of range or named_range_id may be set

sheets[].protectedRanges[].protectedRangeId INTEGER

The ID of the protected range. This field is read-only

sheets[].protectedRanges[].warningOnly BOOLEAN

True if this protected range will show a warning when editing. Warning-based protection means that every user can edit data in the protected range, except editing will prompt a warning asking the user to confirm the edit.

When writing: if this field is true, then editors is ignored. Additionally, if this field is changed from true to false and the editors field is not set (nor included in the field mask), then the editors will be set to all the editors in the document

sheets[].protectedRanges[].requestingUserCanEdit BOOLEAN

True if the user who requested this protected range can edit the protected area. This field is read-only

sheets[].developerMetadata[] OBJECT

Developer metadata associated with a location or object in a spreadsheet. Developer metadata may be used to associate arbitrary data with various parts of a spreadsheet and will remain associated at those locations as they move around and the spreadsheet is edited. For example, if developer metadata is associated with row 5 and another row is then subsequently inserted above row 5, that original metadata will still be associated with the row it was first associated with (what is now row 6). If the associated object is deleted its metadata is deleted too

sheets[].developerMetadata[].metadataId INTEGER

The spreadsheet-scoped unique ID that identifies the metadata. IDs may be specified when metadata is created, otherwise one will be randomly generated and assigned. Must be positive

sheets[].developerMetadata[].location OBJECT

A location where metadata may be associated in a spreadsheet

sheets[].developerMetadata[].visibility ENUMERATION

The metadata visibility. Developer metadata must always have a visibility specified

sheets[].developerMetadata[].metadataValue STRING

Data associated with the metadata's key

sheets[].developerMetadata[].metadataKey STRING

The metadata key. There may be multiple metadata in a spreadsheet with the same key. Developer metadata must always have a key specified

sheets[].basicFilter OBJECT

The default filter associated with a sheet

sheets[].basicFilter.sortSpecs[] OBJECT

A sort order associated with a specific column or row

sheets[].basicFilter.range OBJECT

A range on a sheet. All indexes are zero-based. Indexes are half open, e.g the start index is inclusive and the end index is exclusive -- [start_index, end_index). Missing indexes indicate the range is unbounded on that side.

For example, if "Sheet1" is sheet ID 0, then:

Sheet1!A1:A1 == sheet_id: 0, start_row_index: 0, end_row_index: 1, start_column_index: 0, end_column_index: 1

Sheet1!A3:B4 == sheet_id: 0, start_row_index: 2, end_row_index: 4, start_column_index: 0, end_column_index: 2

Sheet1!A:B == sheet_id: 0, start_column_index: 0, end_column_index: 2

Sheet1!A5:B == sheet_id: 0, start_row_index: 4, start_column_index: 0, end_column_index: 2

Sheet1 == sheet_id:0

The start index must always be less than or equal to the end index. If the start index equals the end index, then the range is empty. Empty ranges are typically not meaningful and are usually rendered in the UI as #REF!

sheets[].basicFilter.range.startRowIndex INTEGER

The start row (inclusive) of the range, or not set if unbounded

sheets[].basicFilter.range.startColumnIndex INTEGER

The start column (inclusive) of the range, or not set if unbounded

sheets[].basicFilter.range.sheetId INTEGER

The sheet this range is on

sheets[].basicFilter.range.endRowIndex INTEGER

The end row (exclusive) of the range, or not set if unbounded

sheets[].basicFilter.range.endColumnIndex INTEGER

The end column (exclusive) of the range, or not set if unbounded

sheets[].basicFilter.criteria OBJECT

The criteria for showing/hiding values per column. The map's key is the column index, and the value is the criteria for that column

sheets[].basicFilter.criteria.customKey OBJECT

Add additional named properties

sheets[].merges[] OBJECT

A range on a sheet. All indexes are zero-based. Indexes are half open, e.g the start index is inclusive and the end index is exclusive -- [start_index, end_index). Missing indexes indicate the range is unbounded on that side.

For example, if "Sheet1" is sheet ID 0, then:

Sheet1!A1:A1 == sheet_id: 0, start_row_index: 0, end_row_index: 1, start_column_index: 0, end_column_index: 1

Sheet1!A3:B4 == sheet_id: 0, start_row_index: 2, end_row_index: 4, start_column_index: 0, end_column_index: 2

Sheet1!A:B == sheet_id: 0, start_column_index: 0, end_column_index: 2

Sheet1!A5:B == sheet_id: 0, start_row_index: 4, start_column_index: 0, end_column_index: 2

Sheet1 == sheet_id:0

The start index must always be less than or equal to the end index. If the start index equals the end index, then the range is empty. Empty ranges are typically not meaningful and are usually rendered in the UI as #REF!

sheets[].merges[].startRowIndex INTEGER

The start row (inclusive) of the range, or not set if unbounded

sheets[].merges[].startColumnIndex INTEGER

The start column (inclusive) of the range, or not set if unbounded

sheets[].merges[].sheetId INTEGER

The sheet this range is on

sheets[].merges[].endRowIndex INTEGER

The end row (exclusive) of the range, or not set if unbounded

sheets[].merges[].endColumnIndex INTEGER

The end column (exclusive) of the range, or not set if unbounded

sheets[].bandedRanges[] OBJECT

A banded (alternating colors) range in a sheet

sheets[].bandedRanges[].bandedRangeId INTEGER

The id of the banded range

sheets[].bandedRanges[].rowProperties OBJECT

Properties referring a single dimension (either row or column). If both BandedRange.row_properties and BandedRange.column_properties are set, the fill colors are applied to cells according to the following rules:

  • header_color and footer_color take priority over band colors.
  • first_band_color takes priority over second_band_color.
  • row_properties takes priority over column_properties.

For example, the first row color takes priority over the first column color, but the first column color takes priority over the second row color. Similarly, the row header takes priority over the column header in the top left cell, but the column header takes priority over the first row color if the row header is not set

sheets[].bandedRanges[].columnProperties OBJECT

Properties referring a single dimension (either row or column). If both BandedRange.row_properties and BandedRange.column_properties are set, the fill colors are applied to cells according to the following rules:

  • header_color and footer_color take priority over band colors.
  • first_band_color takes priority over second_band_color.
  • row_properties takes priority over column_properties.

For example, the first row color takes priority over the first column color, but the first column color takes priority over the second row color. Similarly, the row header takes priority over the column header in the top left cell, but the column header takes priority over the first row color if the row header is not set

sheets[].bandedRanges[].range OBJECT

A range on a sheet. All indexes are zero-based. Indexes are half open, e.g the start index is inclusive and the end index is exclusive -- [start_index, end_index). Missing indexes indicate the range is unbounded on that side.

For example, if "Sheet1" is sheet ID 0, then:

Sheet1!A1:A1 == sheet_id: 0, start_row_index: 0, end_row_index: 1, start_column_index: 0, end_column_index: 1

Sheet1!A3:B4 == sheet_id: 0, start_row_index: 2, end_row_index: 4, start_column_index: 0, end_column_index: 2

Sheet1!A:B == sheet_id: 0, start_column_index: 0, end_column_index: 2

Sheet1!A5:B == sheet_id: 0, start_row_index: 4, start_column_index: 0, end_column_index: 2

Sheet1 == sheet_id:0

The start index must always be less than or equal to the end index. If the start index equals the end index, then the range is empty. Empty ranges are typically not meaningful and are usually rendered in the UI as #REF!

sheets[].charts[] OBJECT

A chart embedded in a sheet

sheets[].charts[].chartId INTEGER

The ID of the chart

sheets[].charts[].position OBJECT

The position of an embedded object such as a chart

sheets[].charts[].spec OBJECT

The specifications of a chart

sheets[].filterViews[] OBJECT

A filter view

sheets[].filterViews[].namedRangeId STRING

The named range this filter view is backed by, if any.

When writing, only one of range or named_range_id may be set

sheets[].filterViews[].filterViewId INTEGER

The ID of the filter view

sheets[].filterViews[].criteria OBJECT

The criteria for showing/hiding values per column. The map's key is the column index, and the value is the criteria for that column

sheets[].filterViews[].title STRING

The name of the filter view

sheets[].filterViews[].range OBJECT

A range on a sheet. All indexes are zero-based. Indexes are half open, e.g the start index is inclusive and the end index is exclusive -- [start_index, end_index). Missing indexes indicate the range is unbounded on that side.

For example, if "Sheet1" is sheet ID 0, then:

Sheet1!A1:A1 == sheet_id: 0, start_row_index: 0, end_row_index: 1, start_column_index: 0, end_column_index: 1

Sheet1!A3:B4 == sheet_id: 0, start_row_index: 2, end_row_index: 4, start_column_index: 0, end_column_index: 2

Sheet1!A:B == sheet_id: 0, start_column_index: 0, end_column_index: 2

Sheet1!A5:B == sheet_id: 0, start_row_index: 4, start_column_index: 0, end_column_index: 2

Sheet1 == sheet_id:0

The start index must always be less than or equal to the end index. If the start index equals the end index, then the range is empty. Empty ranges are typically not meaningful and are usually rendered in the UI as #REF!

spreadsheetUrl STRING

The url of the spreadsheet. This field is read-only

properties OBJECT

Properties of a spreadsheet

properties.locale STRING

The locale of the spreadsheet in one of the following formats:

  • an ISO 639-1 language code such as en

  • an ISO 639-2 language code such as fil, if no 639-1 code exists

  • a combination of the ISO language code and country code, such as en_US

Note: when updating this field, not all locales/languages are supported

properties.iterativeCalculationSettings OBJECT

Settings to control how circular dependencies are resolved with iterative calculation

properties.iterativeCalculationSettings.maxIterations INTEGER

When iterative calculation is enabled, the maximum number of calculation rounds to perform

properties.iterativeCalculationSettings.convergenceThreshold NUMBER

When iterative calculation is enabled and successive results differ by less than this threshold value, the calculation rounds stop

properties.autoRecalc ENUMERATION

The amount of time to wait before volatile functions are recalculated

properties.defaultFormat OBJECT

The format of a cell

properties.defaultFormat.numberFormat OBJECT

The number format of a cell

properties.defaultFormat.numberFormat.type ENUMERATION

The type of the number format. When writing, this field must be set

properties.defaultFormat.numberFormat.pattern STRING

Pattern string used for formatting. If not set, a default pattern based on the user's locale will be used if necessary for the given type. See the Date and Number Formats guide for more information about the supported patterns

properties.defaultFormat.hyperlinkDisplayType ENUMERATION

How a hyperlink, if it exists, should be displayed in the cell

properties.defaultFormat.horizontalAlignment ENUMERATION

The horizontal alignment of the value in the cell

properties.defaultFormat.textFormat OBJECT

The format of a run of text in a cell. Absent values indicate that the field isn't specified

properties.defaultFormat.textFormat.fontFamily STRING

The font family

properties.defaultFormat.textFormat.strikethrough BOOLEAN

True if the text has a strikethrough

properties.defaultFormat.textFormat.italic BOOLEAN

True if the text is italicized

properties.defaultFormat.textFormat.fontSize INTEGER

The size of the font

properties.defaultFormat.textFormat.underline BOOLEAN

True if the text is underlined

properties.defaultFormat.textFormat.bold BOOLEAN

True if the text is bold

properties.defaultFormat.textFormat.foregroundColor OBJECT

Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness; for example, the fields of this representation can be trivially provided to the constructor of "java.awt.Color" in Java; it can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha" method in iOS; and, with just a little work, it can be easily formatted into a CSS "rgba()" string in JavaScript, as well.

Note: this proto does not carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color space.

Example (Java):

 import com.google.type.Color;

 // ...
 public static java.awt.Color fromProto(Color protocolor) {
   float alpha = protocolor.hasAlpha()
       ? protocolor.getAlpha().getValue()
       : 1.0;

   return new java.awt.Color(
       protocolor.getRed(),
       protocolor.getGreen(),
       protocolor.getBlue(),
       alpha);
 }

 public static Color toProto(java.awt.Color color) {
   float red = (float) color.getRed();
   float green = (float) color.getGreen();
   float blue = (float) color.getBlue();
   float denominator = 255.0;
   Color.Builder resultBuilder =
       Color
           .newBuilder()
           .setRed(red / denominator)
           .setGreen(green / denominator)
           .setBlue(blue / denominator);
   int alpha = color.getAlpha();
   if (alpha != 255) {
     result.setAlpha(
         FloatValue
             .newBuilder()
             .setValue(((float) alpha) / denominator)
             .build());
   }
   return resultBuilder.build();
 }
 // ...

Example (iOS / Obj-C):

 // ...
 static UIColor* fromProto(Color* protocolor) {
    float red = [protocolor red];
    float green = [protocolor green];
    float blue = [protocolor blue];
    FloatValue* alpha_wrapper = [protocolor alpha];
    float alpha = 1.0;
    if (alpha_wrapper != nil) {
      alpha = [alpha_wrapper value];
    }
    return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
 }

 static Color* toProto(UIColor* color) {
     CGFloat red, green, blue, alpha;
     if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
       return nil;
     }
     Color* result = [[Color alloc] init];
     [result setRed:red];
     [result setGreen:green];
     [result setBlue:blue];
     if (alpha <= 0.9999) {
       [result setAlpha:floatWrapperWithValue(alpha)];
     }
     [result autorelease];
     return result;
}
// ...

Example (JavaScript):

// ...

var protoToCssColor = function(rgb_color) {
   var redFrac = rgb_color.red || 0.0;
   var greenFrac = rgb_color.green || 0.0;
   var blueFrac = rgb_color.blue || 0.0;
   var red = Math.floor(redFrac * 255);
   var green = Math.floor(greenFrac * 255);
   var blue = Math.floor(blueFrac * 255);

   if (!('alpha' in rgb_color)) {
      return rgbToCssColor_(red, green, blue);
   }

   var alphaFrac = rgb_color.alpha.value || 0.0;
   var rgbParams = [red, green, blue].join(',');
   return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
};

var rgbToCssColor_ = function(red, green, blue) {
  var rgbNumber = new Number((red << 16) | (green << 8) | blue);
  var hexString = rgbNumber.toString(16);
  var missingZeros = 6 - hexString.length;
  var resultBuilder = ['#'];
  for (var i = 0; i < missingZeros; i++) {
     resultBuilder.push('0');
  }
  resultBuilder.push(hexString);
  return resultBuilder.join('');
};

// ...

properties.defaultFormat.backgroundColor OBJECT

Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness; for example, the fields of this representation can be trivially provided to the constructor of "java.awt.Color" in Java; it can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha" method in iOS; and, with just a little work, it can be easily formatted into a CSS "rgba()" string in JavaScript, as well.

Note: this proto does not carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color space.

Example (Java):

 import com.google.type.Color;

 // ...
 public static java.awt.Color fromProto(Color protocolor) {
   float alpha = protocolor.hasAlpha()
       ? protocolor.getAlpha().getValue()
       : 1.0;

   return new java.awt.Color(
       protocolor.getRed(),
       protocolor.getGreen(),
       protocolor.getBlue(),
       alpha);
 }

 public static Color toProto(java.awt.Color color) {
   float red = (float) color.getRed();
   float green = (float) color.getGreen();
   float blue = (float) color.getBlue();
   float denominator = 255.0;
   Color.Builder resultBuilder =
       Color
           .newBuilder()
           .setRed(red / denominator)
           .setGreen(green / denominator)
           .setBlue(blue / denominator);
   int alpha = color.getAlpha();
   if (alpha != 255) {
     result.setAlpha(
         FloatValue
             .newBuilder()
             .setValue(((float) alpha) / denominator)
             .build());
   }
   return resultBuilder.build();
 }
 // ...

Example (iOS / Obj-C):

 // ...
 static UIColor* fromProto(Color* protocolor) {
    float red = [protocolor red];
    float green = [protocolor green];
    float blue = [protocolor blue];
    FloatValue* alpha_wrapper = [protocolor alpha];
    float alpha = 1.0;
    if (alpha_wrapper != nil) {
      alpha = [alpha_wrapper value];
    }
    return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
 }

 static Color* toProto(UIColor* color) {
     CGFloat red, green, blue, alpha;
     if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
       return nil;
     }
     Color* result = [[Color alloc] init];
     [result setRed:red];
     [result setGreen:green];
     [result setBlue:blue];
     if (alpha <= 0.9999) {
       [result setAlpha:floatWrapperWithValue(alpha)];
     }
     [result autorelease];
     return result;
}
// ...

Example (JavaScript):

// ...

var protoToCssColor = function(rgb_color) {
   var redFrac = rgb_color.red || 0.0;
   var greenFrac = rgb_color.green || 0.0;
   var blueFrac = rgb_color.blue || 0.0;
   var red = Math.floor(redFrac * 255);
   var green = Math.floor(greenFrac * 255);
   var blue = Math.floor(blueFrac * 255);

   if (!('alpha' in rgb_color)) {
      return rgbToCssColor_(red, green, blue);
   }

   var alphaFrac = rgb_color.alpha.value || 0.0;
   var rgbParams = [red, green, blue].join(',');
   return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
};

var rgbToCssColor_ = function(red, green, blue) {
  var rgbNumber = new Number((red << 16) | (green << 8) | blue);
  var hexString = rgbNumber.toString(16);
  var missingZeros = 6 - hexString.length;
  var resultBuilder = ['#'];
  for (var i = 0; i < missingZeros; i++) {
     resultBuilder.push('0');
  }
  resultBuilder.push(hexString);
  return resultBuilder.join('');
};

// ...

properties.defaultFormat.backgroundColor.green FLOAT

The amount of green in the color as a value in the interval [0, 1]

properties.defaultFormat.backgroundColor.blue FLOAT

The amount of blue in the color as a value in the interval [0, 1]

properties.defaultFormat.backgroundColor.alpha FLOAT

The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation:

pixel color = alpha * (this color) + (1.0 - alpha) * (background color)

This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is to be rendered as a solid color (as if the alpha value had been explicitly given with a value of 1.0)

properties.defaultFormat.backgroundColor.red FLOAT

The amount of red in the color as a value in the interval [0, 1]

properties.defaultFormat.padding OBJECT

The amount of padding around the cell, in pixels. When updating padding, every field must be specified

properties.defaultFormat.padding.top INTEGER

The top padding of the cell

properties.defaultFormat.padding.left INTEGER

The left padding of the cell

properties.defaultFormat.padding.right INTEGER

The right padding of the cell

properties.defaultFormat.padding.bottom INTEGER

The bottom padding of the cell

properties.defaultFormat.verticalAlignment ENUMERATION

The vertical alignment of the value in the cell

properties.defaultFormat.borders OBJECT

The borders of the cell

properties.defaultFormat.borders.left OBJECT

A border along a cell

properties.defaultFormat.borders.right OBJECT

A border along a cell

properties.defaultFormat.borders.bottom OBJECT

A border along a cell

properties.defaultFormat.borders.top OBJECT

A border along a cell

properties.defaultFormat.textDirection ENUMERATION

The direction of the text in the cell

properties.defaultFormat.wrapStrategy ENUMERATION

The wrap strategy for the value in the cell

properties.defaultFormat.textRotation OBJECT

The rotation applied to text in a cell

properties.defaultFormat.textRotation.angle INTEGER

The angle between the standard orientation and the desired orientation. Measured in degrees. Valid values are between -90 and 90. Positive angles are angled upwards, negative are angled downwards.

Note: For LTR text direction positive angles are in the counterclockwise direction, whereas for RTL they are in the clockwise direction

properties.defaultFormat.textRotation.vertical BOOLEAN

If true, text reads top to bottom, but the orientation of individual characters is unchanged. For example:

| V |
| e |
| r |
| t |
| i |
| c |
| a |
| l |

properties.title STRING

The title of the spreadsheet

properties.timeZone STRING

The time zone of the spreadsheet, in CLDR format such as America/New_York. If the time zone isn't recognized, this may be a custom time zone such as GMT-07:00