How to recover and upload deleted data in kobotoolbox

Recovering deleted data in KoBoToolbox depends on several factors, including whether backups are available or if the data is still retrievable from the system. While losing important data can be stressful, there are several methods you can try to restore it.

In this guide, we’ll walk you through the key recovery options available in KoBoToolbox. From checking built-in archive or trash folders to exploring backup solutions and external recovery methods, we’ll outline the steps you can take to retrieve lost data effectively. By following these best practices, you can improve your chances of successful recovery and ensure your data remains protected in the future.

1.Check Data Table for Soft Deletion

  • Sometimes, submissions are archived instead of permanently deleted.
  • Go to DATA > Table View and check if the data is still available
2. Using ODK Briefcase to upload Data
How to recover and upload deleted data in kobotoolbox

If you collected data using ODK Collect and need to push it back to KoboToolbox, follow these steps:

Steps:

1.Download ODK Briefcase

Click here to Download ODK Briefcase

2.Pull Data from Your Device or Local Storage
  • Open ODK Briefcase.
  • Click “Pull” → Select your ODK Collect storage folder or previously downloaded .xml files.
3.Export Data as CSV (Optional)

Go to “Export” tab → Choose CSV format.

4.Push Data Back to KoboToolbox

3. Using the post method

a. Requirements

Your KoboToolbox API Key (found in Account Settings)
 Your Form ID (to get this, go to your project URL, it looks like aBcDeFGh123)
A backup of your deleted data in CSV, JSON, or Excel format
A tool to make API requests (e.g., Python, Postman, cURL)

b.Convert Your Data to JSON Format

KoboToolbox’s API accepts submissions in JSON format. Your data should look like this:

{ “id”: “your_ form

“submission”: [ { “field1”: “value1”, “field2”: “value2”, “field3”: “value3” }, { “field1”: “value4”, “field2”: “value5”, “field3”: “value6” } ] }

Make sure the field names match exactly with the KoboToolbox form.

c. Send a POST Request to upload Data

You can use PythonPostman, or cURL to send data to KoboToolbox.

d.Verify Your Data in KoboToolbox

  • Go to KoboToolbox > Data > Table View
  • Refresh the page to check if the new submissions appear
  • If necessary, export the data to confirm everything is correct

4.By using scripting method

If you have accidentally deleted data in KoboToolbox, you can attempt to recover and re-upload it using the KoboToolbox API. Below is a complete script in java that:

Retrieves backups (if available)
Restores lost data
Re-uploads deleted records

a.Requirements

KoboToolbox API Key (Find it in Account Settings)

  • Form ID (Check your KoboToolbox URL for the project)
  • Backup of deleted data (CSV, JSON, Excel)

b.Step-by-Step Scripting Approach

i.Get Existing Data (If Available)

         Before restoring data, check if any submissions still exist.

ii. Re-Upload Deleted Data (Using Backup CSV/JSON)

        If you have a backup file (CSV/Excel/JSON), you can re-upload it.

iii.Automate Recovery with a Full Script

IV.Verifying Restored Data

After running the script:
 Log in to KoboToolbox
 Go to Data > Table View
 Check if the missing records have been restored

5.Scripting method by python

If you want to automate tasks in KoboToolbox using Python, you can interact with KoboToolbox API for tasks like:

  • Fetching survey data
  • Submitting data programmatically
  • Managing forms (creating, updating, deleting surveys)
  • Exporting responses to Excel or CSV
  • Automating data analysis
1.Installing Required Libraries

First, install the necessary Python libraries

2.Authenticate with KoboToolbox API

You’ll need an API Token from KoboToolbox.
Find it in KoboToolbox → Account Settings → API Token.

3. Fetch Form Data from KoboToolbox

Python Code to Fetch API Token

4.Export KoboToolbox Data to CSV/Excel

Example: Convert API Data to CSV

5.Submit Data to KoboToolbox via API

If you want to programmatically submit data:

Sending a Form Response via Python

6.Get a List of All Forms in KoboToolbox
7.Download Attachments (Images, Signatures)

If your form includes images, signatures, or file uploads, you can download them using Python

8.Automate Data Processing with Python

After downloading data, you can use pandas, NumPy, or Matplotlib for analysis.

Leave a Comment

Your email address will not be published. Required fields are marked *