capabilities.work

Delete a Table Row by Index

A 5-step recipe with Microsoft Excel. We can help you get access.

Recipe · 5 steps

Delete a Table Row by Index

Safely remove a single row from an Excel table by index.

  1. Open a persisting session so the deletion is committed to the stored workbook.
  2. Resolve the table on the worksheet that the row will be deleted from.
  3. Read every row before deleting so the caller holds a copy of the row about to be destroyed and can confirm the index points at the intended record.
  4. Delete the row at the supplied index. This is destructive, and every row after it shifts up by one, so any cached indexes are invalid afterwards.
  5. Re-read the rows to confirm the record is gone and to hand the caller the re-indexed row set for any further deletions.
What you'll need to have ready
  • itemId: The drive item id of the workbook file.
  • worksheetIdOrName: The worksheet holding the target table.
  • rowIndex: The zero-based index of the row to delete, verified against the snapshot taken by this flow before the delete is issued.
For your developer

Arazzo workflow microsoft-excel:prune-table-row, 5 operations: createWorkbookSession → listTables → listTableRows → deleteTableRow → listTableRows. Specs on APIs.io.