Hello,
I have a fairly large form with calculations. At first, some of the calculations worked in Connect and the Android field app, but not in iOS. I added the coalesce function to some of the calculations, and that made them work in iOS. However, after adding coalesce functions to the final field that was giving me problems, now the form crashes in iOS, but still works in Connect and Android field app. Specifically, adding coalesce to the calculation in field 435 seems to be the tipping point, as without it, the form will not crash, but the calculation will not work. Any help to get the calculation in field 435 to work in iOS without crashing the form would be greatly appreciated!! The two versions of the form are attached.
Thank you,
Mikala
Hi Mikala,
I am not seeing the form crash on my iOS device. That being said, your form does have a large amount of complex calculations, both in the calculation as well as the relevant column. It probably would be best to try to reduce this complexity.
- You have many questions that have identical relevant statements; for example lines 43-54. It's a best practice to place these in a group and only have the relevant statement on the group.
- Your relevant statements on stratum use a series of 'or' statements to check the number of stratum present. It would be much more efficient to covert the 'how many tree stratum' question to a number and evaluate with a less than or greater than statement; for example, lines 43-54 would have the condition: int(${how_many_tree_stratum_d0_you_ne}) >= 1
- A more significant change would be to restructure the tree stratum, sapling stratum, etc. into a series of repeats, with the repeat_count being set by the number of stratum needed. This would reduce the number of questions in the form design and make calculations simpler (by being able to use aggregation functions like sum() ).
You have the relevant statements apply to hidden questions. Given that you have set many of them up to use an if statement that reports 0 otherwise, you could remove the relevant statement. This would also avoid the need to use coalesce.
Hi James, so I did end up implementing repeats and some other suggestions which reduced the size of the form greatly, removed relevant statements for hidden questions, etc. I'll be more specific about where the crash in iOS is happening, as it is still occurring on all iOS devices I test it on. If you select 'No' for the "Rapid test for hydrophytic vegetation met?" question, then choose either Four or Five stratum, and go to one of the repeat stratum sections and go to enter data. Once you enter species, absolute % cover, then go to choose an indicator status for the "Vegetation - Tree Stratum - Indicator Status" (example) question, the form consistently crashes. Any more suggestions would be a huge help! I'll update the original question with my updated xls form sheet.