# Api call crash the whole flow when gets an error

**URL:** https://community.glideapps.com/t/api-call-crash-the-whole-flow-when-gets-an-error/67245
**Category:** Ask for Help
**Created:** [October 24, 2023, 6:17pm UTC](https://community.glideapps.com/t/api-call-crash-the-whole-flow-when-gets-an-error/67245 "2023-10-24T18:17:54Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Alvaro\_Souza](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/alvaro_souza/32/51490_2.png) [@Alvaro\_Souza](https://community.glideapps.com/u/Alvaro_Souza)
#### Post date: [October 24, 2023, 6:17pm UTC](https://community.glideapps.com/t/api-call-crash-the-whole-flow-when-gets-an-error/67245/1 "2023-10-24T18:17:54Z")

</div>

Im building a delete button on my app that erase multiple rows from multiple tables, its looks like this:

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

The problem is that sometimes this tables doesnt have data in it, so when i run the action, some api calls work, but when they meet with empty data, the api returns an error, and the next api calls (that came after this one) stop working.

The way that im building this json it looks like this:

1. i build the simplejson part of it:  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/3/934a30efd235d71d08bce65edf358dab63b1632f.png)

2. Next i append every last json to a mayor one, separated with “,”, like this:  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/6/3677845e9e4ac8f162dd80571f57c1ac8404eef4.png)

3. And then i put all those jsons on mutations, like this:  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/2/8224bdec6143482ce2723aedc1641153e289631c.png)

4. And finally i run that whole JSON with the corresponding headers, api-keys, etc.  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/b/fb3eb0f79faed83ef6e5f11294c2338e4a81a422.png)

how can i fix this?

Thanks!

---

<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 24, 2023, 6:41pm UTC](https://community.glideapps.com/t/api-call-crash-the-whole-flow-when-gets-an-error/67245/2 "2023-10-24T18:41:01Z")

</div>

You know you can just do a Delete Row action through a single or multiple relation without having to mess with the API.

---

<div class="post-metadata">

### Author: ![Alvaro\_Souza](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/alvaro_souza/32/51490_2.png) [@Alvaro\_Souza](https://community.glideapps.com/u/Alvaro_Souza)
#### Post date: [October 24, 2023, 6:48pm UTC](https://community.glideapps.com/t/api-call-crash-the-whole-flow-when-gets-an-error/67245/3 "2023-10-24T18:48:01Z")

</div>

Hi Jeff!

yes, i know that, but that would just delete a single row per table right??

I have to add that this delete button will only delete information from the active users, not from everyone

---

<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 24, 2023, 7:00pm UTC](https://community.glideapps.com/t/api-call-crash-the-whole-flow-when-gets-an-error/67245/4 "2023-10-24T19:00:34Z")

</div>

> [@Alvaro\_Souza](#):
>
> yes, i know that, but that would just delete a single row per table right??

Not unless it’s a multiple relation, then it will delete multiple rows.

 ![Screenshot_20231024-140313](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/a/ca36e39d4565f121a7ac3375d52f4646769c8892.png)

> **[Delete Row](https://www.glideapps.com/docs/automation/actions/delete-row)**
>
> Delete a row of data from a table.

---

<div class="post-metadata">

### Author: ![Alvaro\_Souza](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/alvaro_souza/32/51490_2.png) [@Alvaro\_Souza](https://community.glideapps.com/u/Alvaro_Souza)
#### Post date: [October 24, 2023, 7:05pm UTC](https://community.glideapps.com/t/api-call-crash-the-whole-flow-when-gets-an-error/67245/5 "2023-10-24T19:05:28Z")

</div>

OMG thanks!!!  
🤩

---

<div class="post-metadata">

### Author: ![david](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/david/32/62831_2.png) [@david](https://community.glideapps.com/u/david)
#### Post date: [October 24, 2023, 8:14pm UTC](https://community.glideapps.com/t/api-call-crash-the-whole-flow-when-gets-an-error/67245/6 "2023-10-24T20:14:34Z")

</div>

Also use `JSON Object` and `Lookup` to construct JSON, not `Template` and `Joined List`

---

<div class="post-metadata">

### Author: ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)
#### Post date: [October 31, 2023, 8:15pm UTC](https://community.glideapps.com/t/api-call-crash-the-whole-flow-when-gets-an-error/67245/7 "2023-10-31T20:15:24Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
