# Google Sheets API: Issue deleting rows with Array Formulas

**URL:** <https://community.glideapps.com/t/google-sheets-api-issue-deleting-rows-with-array-formulas/17179>\
**Category:** Ask for Help\
**Created:** [October 15, 2020, 3:18pm UTC](https://community.glideapps.com/t/google-sheets-api-issue-deleting-rows-with-array-formulas/17179 "2020-10-15T15:18:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mauronic](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mauronic/32/21726_2.png) [@Mauronic](https://community.glideapps.com/u/Mauronic)\
**Post date:** [October 15, 2020, 3:18pm UTC](https://community.glideapps.com/t/google-sheets-api-issue-deleting-rows-with-array-formulas/17179/1 "2020-10-15T15:18:09Z")

</div>

I created an automation scenario in Integromat to delete a row in my sheet. It failed with an error code 400 and after several days working with Integretron they pointed out this error in the response:

`Invalid requests[0].deleteRange: You cannot insert or delete cells over an array formula`

Has anyone else encountered this type of error and were you able to work around it?

Maybe instead of deleting the row I need to overwrite a dummy value into the key field (user’s email).

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [October 15, 2020, 3:50pm UTC](https://community.glideapps.com/t/google-sheets-api-issue-deleting-rows-with-array-formulas/17179/2 "2020-10-15T15:50:45Z")

</div>

That’s strange and should not happen. Do you mean Integromat here?

I think you can delete rows based on a condition with a Google Script instead.

---

<div class="post-metadata">

**Author:** ![Mauronic](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mauronic/32/21726_2.png) [@Mauronic](https://community.glideapps.com/u/Mauronic)\
**Post date:** [October 15, 2020, 3:56pm UTC](https://community.glideapps.com/t/google-sheets-api-issue-deleting-rows-with-array-formulas/17179/3 "2020-10-15T15:56:44Z")

</div>

I always confuse the name Integromat with the Integretron in Joshua Tree. 🤣

I am not sure if Google Script would work, but wouldn’t both use a similar API call in the end?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/c/c6e92b18a0ef5981c969ffc6952890c05ef3b9c9.png)

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [October 15, 2020, 4:02pm UTC](https://community.glideapps.com/t/google-sheets-api-issue-deleting-rows-with-array-formulas/17179/4 "2020-10-15T16:02:25Z")

</div>

Here’s a thread with some sample scripts for you to try.

> <https://stackoverflow.com/questions/11058019/delete-a-row-in-google-spreadsheets-if-value-of-cell-in-said-row-is-0-or-blank>

---

<div class="post-metadata">

**Author:** ![Mauronic](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mauronic/32/21726_2.png) [@Mauronic](https://community.glideapps.com/u/Mauronic)\
**Post date:** [October 15, 2020, 4:52pm UTC](https://community.glideapps.com/t/google-sheets-api-issue-deleting-rows-with-array-formulas/17179/5 "2020-10-15T16:52:38Z")

</div>

Thanks, but I am not proficient in Apps Script (or have the time to learn it). That’s why I am starting with the Integromat route for prototyping 😉

I think it’s fair to assume that Apps Script uses the same underlying API that Integromat uses to implement the delete row functionality and may have similar issues.

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [October 15, 2020, 10:49pm UTC](https://community.glideapps.com/t/google-sheets-api-issue-deleting-rows-with-array-formulas/17179/6 "2020-10-15T22:49:07Z")

</div>

Is Integromat attempting to delete the row that contains the arrayformula, or are you getting the error because it’s attempting to delete a row that doesn’t contain the arrayformula, but has a cell that is filled by the arrayformula?

---

<div class="post-metadata">

**Author:** ![Mauronic](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mauronic/32/21726_2.png) [@Mauronic](https://community.glideapps.com/u/Mauronic)\
**Post date:** [October 16, 2020, 5:44am UTC](https://community.glideapps.com/t/google-sheets-api-issue-deleting-rows-with-array-formulas/17179/7 "2020-10-16T05:44:19Z")

</div>

The latter

---

<div class="post-metadata">

**Author:** ![mmgt2005](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mmgt2005/32/965_2.png) [@mmgt2005](https://community.glideapps.com/u/mmgt2005)\
**Post date:** [October 16, 2020, 4:15pm UTC](https://community.glideapps.com/t/google-sheets-api-issue-deleting-rows-with-array-formulas/17179/8 "2020-10-16T16:15:57Z")

</div>

I have encountered this before. My workaround for now is to do as you said overwrite a dummy value into the key field. Along with moving that row to an archive sheet just in case the row needs to be restored. Archive first, then update the row you want to delete.
