Hi!
I have a question about dynamic data attachments, relating to preventing a duplicate entry for an ID code - but unique behaviour that then prevents any sort of editing of data after the initial submission.
Here is my XLSForm for my test use-case:
a6TsoUEr7MieHBYT7tzef4.xlsx (9.6 KB)
What I am doing is linking the form to itself - it is both the parent and the child.
-
When I put in a new HH ID number, the form counts the number of times that HH ID has previously been entered in the data table.
-
If the HH ID has not been previously used (e.g., ${hhid_check} = 0) - then the form will validate and you can submit the new data.
-
However, if the HH ID has been previously used (e.g., ${hhid_check} > 0) - then the form shows an ‘error note’ and will not allow the form to be submitted. It requires a correction of the HH ID entered.
Overall, this method prevents duplication of HH ID numbers being submitted.
However, here’s the problem:
In my workflow, I have a step where data cleaning/correction will happen from KoboToolbox. But when going to ‘editing’ mode of the form - I cannot edit the form because of the dynamic data attachment.
-
So in the data table, you can see that there is only one row with HHID LHS.BF.0SK.002:
-
Now I want to edit that submission to change the number of HH members from 5 to 6, for example if I made an error in my submission. But when I click to edit the submission, change to 6, and then submit again - the error message appears that there is a previous submission of this HH ID number. So I cannot submit the edit.
Essentially, this error prevents any data cleaning of a form where I use dynamic data attachments to prevent duplication of an ID number.
Is there a workaround?
As I’m brainstorming a solution, I wonder if this is somewhat a flaw in how the parent/child relationship executes when in editing mode…as in, I think it’s doing exactly as it’s programmed to do…but there is a difference in deduplicating for a new submission and then editing an existing submission.
You wouldn’t want to be able to change a HH ID when in editing mode to an ID number that has already been used, but likewise, shouldn’t you be able to not change the ID number when editing other fields, and still be allowed to submit the edit?
With this behaviour, data cleaning/editing within KoboToolbox is impossible.
If someone has come across this problem before and has figured out a workaround, please let me know! Or if this is a known limitation of dynamic data attachments, it would also be helpful to understand.
Many thanks in advance!
Janna