How to download Data between two dates from date to date

Hi @Ahmad1, this is possible, but unfortunately there is currently no UI to easily create the filtered export. To do this, you can navigate to the following URL with your ASSET_UID and KF_URL depending on the server you are using:

https://<KF_URL>/api/v2/assets/<ASSET_UID>/exports/

for example:

HHI

https://kf.kobotoolbox.org/api/v2/assets/arhhVdJxyFxguzdyhuDZWb/exports/

OCHA

https://kobo.humanitarianresponse.info/api/v2/assets/arhhVdJxyFxguzdyhuDZWb/exports/

Then paste the following JSON in the “Content” field in the form at the bottom of the page (ensure that the “Raw data” tab is selected) and click the POST button:

{
  "fields_from_all_versions": true,
  "group_sep": "/",
  "hierarchy_in_labels": true,
  "lang": "_default",
  "multiple_select": "both",
  "type": "xls",
  "xls_types_as_text": false,
  "include_media_url": true,
  "query": {
    "$and": [
      {
        "_submission_time": {
          "$gte": "2021-02-15"
        }
      },
      {
        "_submission_time": {
          "$lte": "2021-02-25"
        }
      }
    ]
  }
}

You can then navigate back to the KoBoToolbox UI and download the export as normal:

3 Likes