getodk / getodk/central

Empty repeat instances are confusing in CSV export

Open
#943 0 comments 0 reactions 0 assignees View on GitHub
backend needs discussion
Dominant language
JavaScript
Stars
226
Forks
235
Avg merge
2d 22h
Merged PRs (30d)
19

Description

I have run into a couple of cases where repeat data exports include empty rows. This is confusing to explain to users even though it technically does match the submission XML. This happens when a repeat instance's contents were left blank or became non-relevant.

Here are some forms that can result in empty repeat instances:
* [dynamic_repeat_count.xlsx](https://github.com/user-attachments/files/19542176/dynamic_repeat_count.xlsx) -- the user expresses being done attaching images by no longer attaching more. The last repeat instance only contains fields without values. See an example submission: https://staging.getodk.cloud/v1/projects/11/forms/dynamic_repeat_count/submissions/uuid%3Acf46fccf-8137-4b64-84b0-6089ac9abeef.xml and the export:
[dynamic_repeat_count.zip](https://github.com/user-attachments/files/19542347/dynamic_repeat_count.zip)

* [parallel repeats](https://docs.google.com/spreadsheets/d/1Ca8fbhpGpdaxLAnSSebrGRnbey5U0FUbJM_pVxjReKI/edit?gid=1068911091#gid=1068911091) Only look at the adults repeat because the kid one is broken in various ways in different clients. Looking at the adults repeat, if there's a position at which the condition doesn't apply, the submission XML has no contents because the inner group is non-relevant. There's an empty row for that repeat instance in the export.

Options:
* decide that the current state matches the submission and leave things as they are. These forms show useful techniques but they're probably not very common and it's not a huge deal to filter out empty rows.
* when a repeat instance has no children whatsoever (second case), we don't output a row.
* when a repeat instance's export row would be empty, we don't output a row.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.