# Delete Data

This action removes individual rows or all data in your table.&#x20;

Below you will learn more about the two available options.

### Delete All Rows

All data is permanently removed.

It's a useful option if you regularly run your TaskBot to collect data and want to overwrite old data with newly collected data on every run. Simply place *Delete Data* building block at the beginning of your workflow before any loops start.

### **Delete One Row**

This option is useful for the case when you want to delete only if a certain condition is met.

#### Example: Remove disqualified leads if lead qualification status does not equal "qualified"

Imagine you collected a list of leads. Your TaskBot updated the column "Qualification" in the table by checking for certain keywords. (There is an example set-up for auto-qualifying leads here: [#example-1-mark-leads-as-qualified-if-certain-conditions-are-fulfilled](https://docs.zerowork.io/using-zerowork/update-data#example-1-mark-leads-as-qualified-if-certain-conditions-are-fulfilled "mention").) Now every lead that is qualified is marked with the word "Qualified" in the table. Your goal is to delete all the disqualified leads.

This is the workflow set-up:

<figure><img src="https://3220183989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg9LcR8XM7TGOzOCDGsCS%2Fuploads%2FgWlZqGm3rk5UlRvCav5b%2FScreenshot%202023-11-21%20at%2014.46.07.png?alt=media&#x26;token=58e72496-92ad-4fe9-b0c0-5a93a233fc34" alt=""><figcaption></figcaption></figure>

The loop is set up to iterate over rows (see [start-repeat](https://docs.zerowork.io/using-zerowork/using-building-blocks/start-repeat "mention")).

<figure><img src="https://3220183989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg9LcR8XM7TGOzOCDGsCS%2Fuploads%2FJMBd02t6kMAqQA2Q5TBk%2FScreenshot%202023-11-21%20at%2014.47.11.png?alt=media&#x26;token=bd8d6513-6a84-4988-ac32-567cb635caa5" alt=""><figcaption></figcaption></figure>

*Start Condition* building block sets the column "Qualification" as the reference.

<figure><img src="https://3220183989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg9LcR8XM7TGOzOCDGsCS%2Fuploads%2FW4FUTYLVqfELPsoAfhQG%2FScreenshot%202023-11-21%20at%2014.48.46.png?alt=media&#x26;token=58a4b389-0ecf-4c15-8f32-a1c3decc19dd" alt=""><figcaption></figcaption></figure>

Condition in *Set Condition* is set to filter out the qualified leads.

<figure><img src="https://3220183989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg9LcR8XM7TGOzOCDGsCS%2Fuploads%2FZcfLjvkkxF3FAbRDcA6b%2FScreenshot%202023-11-21%20at%2014.47.46.png?alt=media&#x26;token=829b3c6b-3648-4464-bf6d-85cc2f78824c" alt=""><figcaption></figcaption></figure>

The last building block in this sequence is *Delete Data* and it deletes one row during each loop iteration, as long as the above condition was fulfilled.

<figure><img src="https://3220183989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg9LcR8XM7TGOzOCDGsCS%2Fuploads%2FBPBckqjj3dGzhoQYTSpg%2FScreenshot%202023-11-21%20at%2014.52.23.png?alt=media&#x26;token=cfc62db1-7432-4c18-b098-ded2279a5861" alt=""><figcaption></figcaption></figure>

### Video Tutorial

{% embed url="<https://youtu.be/rJupYjpyC1U?si=XKqtf0InBsz10q58>" %}
