# How to delete records using for loop

**URL:** <https://community.thunkable.com/t/how-to-delete-records-using-for-loop/1415225>\
**Category:** Questions about Thunkable X\
**Tags:** beginner\
**Created:** [July 26, 2021, 3:13pm UTC](https://community.thunkable.com/t/how-to-delete-records-using-for-loop/1415225 "2021-07-26T15:13:52Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![arleen](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@arleen](https://community.thunkable.com/u/arleen)\
**Post date:** [July 26, 2021, 3:13pm UTC](https://community.thunkable.com/t/how-to-delete-records-using-for-loop/1415225/1 "2021-07-26T15:13:52Z")

</div>

How to delete all records for a condition  
I use this block but it shows some error like this after deleting one record.  
No \_id property was specified in the provided row…

 ![error](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/d/4db5a864db8f1b146a7a3edbf5298d65b2f17bcf.png)

My purpose is to move all records to completed list table on a condition.

Thanks

---

<div class="post-metadata">

**Author:** ![arleen](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@arleen](https://community.thunkable.com/u/arleen)\
**Post date:** [August 2, 2021, 5:26am UTC](https://community.thunkable.com/t/how-to-delete-records-using-for-loop/1415225/2 "2021-08-02T05:26:44Z")

</div>

why not answering?

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [August 2, 2021, 10:51am UTC](https://community.thunkable.com/t/how-to-delete-records-using-for-loop/1415225/3 "2021-08-02T10:51:15Z")

</div>

There is not enough info to answer.

In the Alert show the content of “j” as the Alert message.

I have to see the content of the row to tell you what is wrong.

---

<div class="post-metadata">

**Author:** ![arleen](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@arleen](https://community.thunkable.com/u/arleen)\
**Post date:** [August 2, 2021, 5:29pm UTC](https://community.thunkable.com/t/how-to-delete-records-using-for-loop/1415225/4 "2021-08-02T17:29:16Z")

</div>

Here I am trying to create a record from pending orderlist table to completed orderlist table and it is working fine. After creating I want to remove the same from pending orderlist table.  
This also works but removes only one record from pending orderlist table.  
j has the items from pending orderlist table and looped. I am using the same object for adding to completed orderList table and also for removing from Pending OrderList table.  
I think now it is clear.  
Thanks.

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [August 3, 2021, 8:19am UTC](https://community.thunkable.com/t/how-to-delete-records-using-for-loop/1415225/5 "2021-08-03T08:19:50Z")

</div>

No, not clear.

The error is talking about \_id which is a key in the JSON of the row. Please show the content of the row by using my suggestion.

---

<div class="post-metadata">

**Author:** ![arleen](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@arleen](https://community.thunkable.com/u/arleen)\
**Post date:** [August 3, 2021, 12:02pm UTC](https://community.thunkable.com/t/how-to-delete-records-using-for-loop/1415225/6 "2021-08-03T12:02:11Z")

</div>

Ok Let us leave about this error  
Can you please explain me how to move records from one table to another for a given field. For eg. I want to move all records from table a to table b for itemid = 5.  
Thanks.

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [August 3, 2021, 4:26pm UTC](https://community.thunkable.com/t/how-to-delete-records-using-for-loop/1415225/7 "2021-08-03T16:26:47Z")

</div>

Will make an example app and share it. This way will be clear.

Check this  
[https://x.thunkable.com/projectPage/5fb9fb1dbfeb240011084d78](https://x.thunkable.com/projectPage/5fb9fb1dbfeb240011084d78)

When you choose a category, only rows of this category is being added to the table.

---

<div class="post-metadata">

**Author:** ![arleen](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@arleen](https://community.thunkable.com/u/arleen)\
**Post date:** [August 7, 2021, 4:04am UTC](https://community.thunkable.com/t/how-to-delete-records-using-for-loop/1415225/8 "2021-08-07T04:04:04Z")

</div>

I removed all code and added freshly. I think now working.  
Thanks.

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 1:17pm UTC](https://community.thunkable.com/t/how-to-delete-records-using-for-loop/1415225/9 "2024-11-08T13:17:47Z")

</div>


