Bulk Deleting of Data

I want to delete multiple records (captured by specific user) from ODK Aggregate.

I understand I can download the CSV file data and mark Delete as True, then transfer the data again to aggregate server. However considering other users have the same data on their tablets, the next time they Sync will it not restore the Deleted data? Is there anything I have to do to preserve the Deletes.
Also is there a moment when all the Deleted data will be completely deleted from the server or it will remain there with the Delete flag?

If you use ODK-X suitcase to download the data, then mark which records to delete and make that update on the server using Suitcase, that will then delete those records from the tablets when they next sync. All the data would sit there on the server with the delete on the row, since you would not be sure when people sync, so if a fieldwork syncs a month later or something, they would still need the delete record to be on the server.

@elmps2018 thanks for the quick response. Just one more question.
Does this only work when I upload using Suitcase only? If I make changes to my CSV file and I load that on my development tablet and Sync to the server, will that work as well?

1 Like

I think that would work too so long as you use a tablet with the right permissions; it’s also an easy one to test by trying it out.

Hi @elmps2018

After going through this process:

  • Downloading al data using ODK Suitcase

  • Changed the “_deleted” flag to TRUE on all the data I wanted to delete

  • Transferred the CSV file to my assets/csv folder for preloading the data on my developer machine

  • Pushed my files to Android

  • Reset the application Server

  • After successfully syncing, I downloaded the data.

Surprisingly the _deleted has been turn to FALSE.
But if I delete directly from Aggregate it works. The challenge is I have lots of rows to delete and I have to do it accurately.

Is there anything else I am not doing right.

Ah, I think the issue is that you are using the aggregate syntax to update. Try using Suitcase and delete as in this post:


This shows how to delete using suitcase.

@elmps2018 thanks for the Suitcase route. It has worked very well both for deleting and updating. Many thanks.

1 Like