1. What is the problem? Be very detailed.
We have a form with a dynamic default (i.e. calculation + trigger columns) that is working fine on Enketo. However, on ODK Collect (v.1.30.1), it is only working for the questions within the same group. The form uses If Statements to pre-fill the questions that are in the same group as the root calculation.
2. What app or server are you using and on what device and operating system? Include version numbers.
ONA is the aggregate server. Enketo version: version:2.5.6-b806da5-0494858
3. What have you tried to fix the problem?
Tried to remove the groups. The form seems to work on ODK Collect when the groups are removed
4. What steps can we take to reproduce the problem?
Uploaded the form on Ona
Launched the form on Enketo. The form works as expected
Ran the form and noticed that the trigger was not working for the questions in the group that followed the question referenced in the trigger column.
5. Anything else we should know or have? If you have a test form or screenshots or logs, attach below.
Attached is the XLSForm matrix_test.xls (20.4 KB)
Hi, had this problem as well, can anyone support? Is this an ODK app bug? Is there anything we can WITHOUT changing the form structure?
I.e. we know we can add calculates to the groups referencing earlier question, and then use this, but would prefer not to create multiple duplicate columns in the export.
It seemed to work (in Enketo and in ODK Collect if I deleted the trigger from the questions inside the group group_qm6di55. Is it intended that the user can change the value to something other than "no info"? If the answer should always be "no info" for those questions - did you consider using relevant to control which questions the user can answer?
Also I think L22 (if(once(${group_kb06p35.Quick_visit_only_Ho_neficiaries_observed})=0,'no_info',''))
should just be if(once(${Quick_visit_only_Ho_neficiaries_observed})=0,'no_info','')
Hi, thanks @danbjoseph for your support, apologies for the super late reply. Only found time to come back to this issue now.
No, the answer could be "good" or "bad", just most commonly "no info". So relevant doesn't fit the use case.
Thanks, this works, BUT we cannot finalize and submit the form. When you finish the form and try to finalize it takes you back to the initial question (e.g. BSFP Distribution) and now it appears empty. This happens no matter what value you enter in the ${Quick_visit_only_Ho_neficiaries_observed} field.
FYI I was able to make the default calculation in the form work by using if(once(${Quick_visit_only_Ho_neficiaries_observed})=0,'no_info',null)
The form successfully pre-loads "no_info" when no. of beneficiaries is equal to 0, and has no selection when no. of beneficiaries is higher than 0. Both are submitted to the server successfully.
However, new problem: the default calculation is overriding the user choice.
E.g., no. of beneficiaries is equal to 0. This pre-loads "no_info" as a default answer. The user changes the default choice to another selection, for example "good". The user successfully submits the form. But when I download the data, I see "no_info" even though the user changed the value. In practice the default is acting like relevant, which is not what I need.
I also tried removing the groups, removing the trigger column, removing audit (the metadata field) and also the appearance attributes but it still doesn't work. It seems to work on Enketo but upon testing on ODK Collect, it doesn't. I suspect it's a bug on ODK that may be causing the issue.
Thanks for the report and apologies for losing track of this one. There's a fix in the latest v2022.3 beta that we'd appreciate feedback on. CC @ahblake who also ran into this recently.
There's some risk to the fix around repeats and dynamic defaults, especially when using nested repeats. If you have forms that use dynamic defaults that are NOT set from within the same repeat instance, please send us the forms so we can add them to our test suite.
I think I've hit a related issue in Enketo? For fields triggered off a non-relevant value.
A form has a question in Group 1 (G1-Q1), that when selected will prefill other questions (G1-G2 & G2-Q4). There is later question (G1-Q3) that if Yes will make Group 2 relevant.
If G1-Q3 is null/No and I select an item in G1-Q1, G1-Q2 prefills correctly. Then selecting Yes for G1-Q3 makes Group 2 relevant and G2-Q4 is also prefilled correctly, however a series of fields that have calculates to lookup/set values and are triggered off G2-Q4 are blank.
If I select Yes on G1-Q3 to make Group 2 relevant and then select an item in G1-Q1, G1-Q2 & G2-Q4 are prefilled correctly, and the series of fields that have calculates to lookup/set values and are triggered off G2-Q4 are also correctly prefilled.
Defaulting G1-Q3 to Yes does fix the form in Enketo as a workaround
This doesn't happen in Collect, G1-Q3 can be null/No, but the triggered calculations in Group 2 all work.