# Clear google sheet before adding new rows

**URL:** <https://community.make.com/t/clear-google-sheet-before-adding-new-rows/26843>\
**Category:** Questions\
**Tags:** google-sheets\
**Created:** [February 8, 2024, 1:49pm UTC](https://community.make.com/t/clear-google-sheet-before-adding-new-rows/26843 "2024-02-08T13:49:54Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![samliew](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/samliew/32/13327_2.png) [@samliew](https://community.make.com/u/samliew)\
**Post date:** [February 8, 2024, 2:15pm UTC](https://community.make.com/t/clear-google-sheet-before-adding-new-rows/26843/4 "2024-02-08T14:15:04Z")

</div>

Personally I prefer to delete all rows and unused columns from the sheet.

After adding a new sheet to your workbook, there will be a thousand rows.

Here’s the batchUpdate endpoint you can call using the “Make an API call” module, that will delete everything except the first row:

 ![Screenshot_2024-02-08_220255](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/2/5/259c76002c82e97c891d71e570121e72858adfe2.png)

(module [5] is my “Add a Sheet” module)

`POST` — `spreadsheets/{{5.spreadsheetId}}:batchUpdate`

```plaintext
{
  "requests": [
    {
      "deleteDimension": {
        "range": {
          "sheetId": {{5.replies[].addSheet.properties.sheetId}},
          "dimension": "ROWS",
          "startIndex": 1,
          "endIndex": {{5.replies[].addSheet.properties.gridProperties.rowCount}}
        }
      }
    },
    {
      "deleteDimension": {
        "range": {
          "sheetId": {{5.replies[].addSheet.properties.sheetId}},
          "dimension": "COLUMNS",
          "startIndex": 4,
          "endIndex": {{5.replies[].addSheet.properties.gridProperties.columnCount}}
        }
      }
    }
  ]
}

```

 ![Screenshot_2024-02-08_220255 - Copy](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/6/f/6f1e50aeea447d89f8fb447137d185110715437c.png)

---

_[View the full topic](https://community.make.com/t/clear-google-sheet-before-adding-new-rows/26843)._
