Spreadsheet Component


Properties

applicationName
  The name of your application, used when making API calls.
Data type: string
Designer Writable true <spreadsheet name="spreadsheetName" applicationName="Test applicationName">
Code Writeable false
Code Readable false

credentialsJson
  The JSON File with credentials for the Service Account
Data type: string
Designer Writable true <spreadsheet name="spreadsheetName" credentialsJson="Test credentialsJson">
Code Writeable true spreadsheetName.credentialsJson = "Test credentialsJson"
Code Readable true let variable = spreadsheetName.credentialsJson

spreadsheetID
  The ID for the Google Sheets file you want to edit. You can find the spreadsheetID in the URL of the Google Sheets file.
Data type: string
Designer Writable true <spreadsheet name="spreadsheetName" spreadsheetID="Test spreadsheetID">
Code Writeable true spreadsheetName.spreadsheetID = "Test spreadsheetID"
Code Readable true let variable = spreadsheetName.spreadsheetID

class
  The styling class of the the component
Data type: string
Designer Writable true <spreadsheet name="spreadsheetName" class="Test class">
Code Writeable false
Code Readable false

id
  The styling id of the the component
Data type: string
Designer Writable true <spreadsheet name="spreadsheetName" id="Test id">
Code Writeable false
Code Readable false

name
  The name of the component that will be used to refer to it in code.
Data type: string
Designer Writable true <spreadsheet name="spreadsheetName" name="testComponent">
Code Writeable false
Code Readable false

Methods

Method name Description Parameters
addCol Given a list of values as data, appends the values to the next empty column of the sheet. It will always start from the top row and continue downwards. Once complete, it triggers the FinishedAddCol callback event.
spreadsheetName.addCol(sheetName, data)
spreadsheetName.addCol("Test sheetName", )
sheetName string
data list
addRow Given a list of values as data, appends the values to the next empty row of the sheet. It will always start from the left most column and continue to the right. Once complete, it triggers the FinishedAddRow callback event. Additionally, this returns the row number for the new row.
spreadsheetName.addRow(sheetName, data)
spreadsheetName.addRow("Test sheetName", )
sheetName string
data list
clearRange Empties the cells in the given range. Once complete, this block triggers the FinishedClearRange callback event.
spreadsheetName.clearRange(sheetName, rangeReference)
spreadsheetName.clearRange("Test sheetName", "Test rangeReference")
sheetName string
rangeReference string
getCellReference Converts the integer representation of rows and columns to A1-Notation used in Google Sheets for a single cell. For example, row 1 and col 2 corresponds to the string "B1".
spreadsheetName.getCellReference(row, col)
spreadsheetName.getCellReference(1, 1)
row number
col number
getRangeReference Converts the integer representation of rows and columns for the corners of the range to A1-Notation used in Google Sheets. For example, selecting the range from row 1, col 2 to row 3, col 4 corresponds to the string "B1:D3".
spreadsheetName.getRangeReference(row1, col1, row2, col2)
spreadsheetName.getRangeReference(1, 1, 2, 2)
row1 number
col1 number
row2 number
col2 number
readCell On the page with the provided sheetName, reads the cell at the given cellReference and triggers the GotCellData callback event. The cellReference can be either a text block with A1-Notation, or the result of the getCellReference block.
spreadsheetName.readCell(sheetName, cellReference)
spreadsheetName.readCell("Test sheetName", "A1")
sheetName string
cellReference string
readCol On the page with the provided sheetName, reads the column at the given colNumber and triggers the GotColData callback event.
spreadsheetName.readCol(sheetName, colNumber)
spreadsheetName.readCol("Test sheetName", )
sheetName string
colNumber number
readRange On the page with the provided sheetName, reads the cells at the given rangeReference and triggers the GotRangeData callback event. The rangeReference can be either a text block with A1-Notation, or the result of the getRangeReference block.
spreadsheetName.readRange(sheetName, rangeReference)
spreadsheetName.readRange("Test sheetName", "Test rangeReference")
sheetName string
rangeReference string
readRow On the page with the provided sheetName, reads the row at the given rowNumber and triggers the GotRowData callback event.
spreadsheetName.readRow(sheetName, rowNumber)
spreadsheetName.readRow("Test sheetName", 0)
sheetName string
rowNumber number
readSheet Reads the entire Google Sheets document and triggers the GotSheetData callback event.
spreadsheetName.readSheet(sheetName)
spreadsheetName.readSheet("Test sheetName")
sheetName string
readWithExactFilter Filters a Google Sheet for rows where the given column number matches the provided value.
spreadsheetName.readWithExactFilter(sheetName, colID, value)
spreadsheetName.readWithExactFilter("Test sheetName", 0, "Test value")
sheetName string
colID number
value string
readWithPartialFilter Filters a Google Sheet for rows where the given column number contains the provided value string.
spreadsheetName.readWithPartialFilter(sheetName, colID, value)
spreadsheetName.readWithPartialFilter("Test sheetName", 0, "Test value")
sheetName string
colID number
value string
removeCol Deletes the column with the given column number from the table. This does not clear the column, but removes it entirely. The sheet's grid id can be found at the end of the url of the Google Sheets document, right after the "gid=". Once complete, it triggers the FinishedRemoveCol callback event.
spreadsheetName.removeCol(sheetName, colNumber)
spreadsheetName.removeCol("Test sheetName", 0)
sheetName string
colNumber number
removeRow Deletes the row with the given row number (1-indexed) from the table. This does not clear the row, but removes it entirely. The sheet's grid id can be found at the end of the url of the Google Sheets document, right after the "gid=". Once complete, it triggers the FinishedRemoveRow callback event.
spreadsheetName.removeRow(sheetName, rowNumber)
spreadsheetName.removeRow("Test sheetName", 0)
sheetName string
rowNumber number
writeCell Given text or a number as data, writes the value to the cell. It will override any existing data in the cell with the one provided. Once complete, it triggers the FinishedWriteCell callback event.
spreadsheetName.writeCell(sheetName, cellReference, data)
spreadsheetName.writeCell("Test sheetName", "Test cellReference", "any")
sheetName string
cellReference string
data any
writeCol Given a list of values as data, writes the values to the column with the given column number, overriding existing values from top down. (Note: It will not erase the entire column.) Once complete, it triggers the FinishedWriteCol callback event.
spreadsheetName.writeCol(sheetName, colNumber, data)
spreadsheetName.writeCol("Test sheetName", 0, )
sheetName string
colNumber number
data list
writeRange Given list of lists as data, writes the values to cells in the range. The number of rows and columns in the range must match the dimensions of your data. This method will override existing data in the range. Once complete, it triggers the FinishedWriteRange callback event.
spreadsheetName.writeRange(sheetName, rangeReference, data)
spreadsheetName.writeRange("Test sheetName", "Test rangeReference", )
sheetName string
rangeReference string
data list
writeRow Given a list of values as data, writes the values to the row with the given row number, overriding existing values from left to right. (Note: It will not erase the entire row.) Once complete, it triggers the FinishedWriteRow callback event.
spreadsheetName.writeRow(sheetName, rowNumber, data)
spreadsheetName.writeRow("Test sheetName", 0, )
sheetName string
rowNumber number
data list
addEventListener Method used to create event listeners.
See Events below for samples.
eventName string
eventCallbackFunction callback

Events

Event name Description Parameters
errorOccurred Triggered whenever an API call encounters an error. Details about the error are in errorMessage.
spreadsheetName.addEventListener(
    "errorOccurred",
    function (errorMessage) {
        //Your code here
    }
)
errorMessage string
finishedAddCol The callback event for the AddCol block, called once the values on the table have been updated. Additionally, this returns the column number for the new column.
spreadsheetName.addEventListener(
    "finishedAddCol",
    function (columnNumber) {
        //Your code here
    }
)
columnNumber number
finishedAddRow The callback event for the AddRow block, called once the values on the table have been updated. Additionally, this returns the row number for the new row.
spreadsheetName.addEventListener(
    "finishedAddRow",
    function (rowNumber) {
        //Your code here
    }
)
rowNumber number
finishedClearRange The callback event for the ClearRange block, called once the values on the table have been updated.
spreadsheetName.addEventListener(
    "finishedClearRange",
    function () {
        //Your code here
    }
)
finishedRemoveCol The callback event for the RemoveCol block, called once the values on the table have been updated.
spreadsheetName.addEventListener(
    "finishedRemoveCol",
    function () {
        //Your code here
    }
)
finishedRemoveRow The callback event for the RemoveRow block, called once the values on the table have been updated.
spreadsheetName.addEventListener(
    "finishedRemoveRow",
    function () {
        //Your code here
    }
)
finishedWriteCell The callback event for the WriteCell block, called once the values on the table have been updated.
spreadsheetName.addEventListener(
    "finishedWriteCell",
    function () {
        //Your code here
    }
)
finishedWriteCol The callback event for the WriteCol block, called once the values on the table have been updated.
spreadsheetName.addEventListener(
    "finishedWriteCol",
    function () {
        //Your code here
    }
)
finishedWriteRange The callback event for the WriteRange block, called once the values on the table have been updated.
spreadsheetName.addEventListener(
    "finishedWriteRange",
    function () {
        //Your code here
    }
)
finishedWriteRow The callback event for the WriteRow block, called once the values on the table have been updated.
spreadsheetName.addEventListener(
    "finishedWriteRow",
    function () {
        //Your code here
    }
)
gotCellData The callback event for the ReadCell block. The cellData is the text value in the cell.
spreadsheetName.addEventListener(
    "gotCellData",
    function (cellData) {
        //Your code here
    }
)
cellData string
gotColData The callback event for the ReadCol block. The colDataList is a list of text cell-values in order of increasing row number.
spreadsheetName.addEventListener(
    "gotColData",
    function (colDataList) {
        //Your code here
    }
)
colDataList list
gotFilterResult The callbeck event for the ReadWithQuery block. The response is a list of rows, where each row satisfies the query.
spreadsheetName.addEventListener(
    "gotFilterResult",
    function (return_rows, return_data) {
        //Your code here
    }
)
return_rows list
return_data list
gotRangeData The callback event for the ReadRange block. The rangeData is a list of rows, where the dimensions are the same as the rangeReference.
spreadsheetName.addEventListener(
    "gotRangeData",
    function (rangeData) {
        //Your code here
    }
)
rangeData list
gotRowData The callback event for the ReadRow block. The rowDataList is a list of text cell-values in order of increasing column number.
spreadsheetName.addEventListener(
    "gotRowData",
    function (rowDataList) {
        //Your code here
    }
)
rowDataList list
gotSheetData The callback event for the ReadSheet block. The sheetData is a list of rows.
spreadsheetName.addEventListener(
    "gotSheetData",
    function (sheetData) {
        //Your code here
    }
)
sheetData list