Introduction to Table Content Endpoints#
Workiva’s table endpoints allow customers to interact with tables embedded in documents and tables in sheets of a spreadsheet. This guide answers the following questions:
How do I retrieve content from an embedded table or spreadsheet sheet?
How do I edit content in an embedded table or spreadsheet sheet?
Example Use Cases#
How do I retrieve content from an embedded table or spreadsheet sheet?#
To retrieve content from an embedded table, use the tableId ID. The tableId can be retrieved in a few ways:
Through calling the GET rich text paragraphs endpoint and using the
table.tableproperty of theTableTextElementcorresponding to the embedded table’s content.Through calling the GET drawing elements endpoint and using the
table.tableproperty of theTableDrawingElementcorresponding to the embedded table’s content.Through calling the GET rich text edit results endpoint after inserting a table in a rich text batch edit.
The tableId for a spreadsheet Sheet can be found in the sheet.table property in the results of a GET sheets or GET sheet by id request.
The table’s cell content can then be retrieved using a GET table cells request to get a TableCellsResult. The table cells result will contain a collection of CellValue values, grouped by row, with the content of each cell.
The table’s row properties can be retrieved using a GET table row properties request to get a RowPropertiesListResult. Each index of the row properties list corresponds to the zero based row index of the table.
The table’s column properties can be retrieved using the GET table column properties request to get a ColumnPropetiesListResult. Each index of the column properties list corresponds to the zero based column index of the table.
How do I edit content in an embedded table or spreadsheet sheet?#
The table’s cell content can be edited using a POST cells batch edit request. A TableCellsBatchEdit supports setting or clearing the text or formats over ranges of cells, as well as applying a RichCellBatchEdit to specific cells. A rich cell batch edit can be on any rich text cell or empty cell.
Tip
If a cell value is a CellFormulaValue or CellPlainTextValue, the value must first be cleared before a rich text edit can be made on the cell.
If a cell is a CellDestinationLinkValue, the destination link must be removed in order to perform rich text edits through a remove links table links edit.
Important
RichCellBatchEdits work similar to RichTextBatchEdits, but have some limitations around what embedded content can be inserted into a cell. For example, an insertTable edit is not supported in a rich cell batch edit.
The table’s structure can be edited using a POST table edit request. A TableEdit supports inserting, deleting, and moving rows or columns.