@nathalie_H and I are working on a sort of Holy Grail of forms to monitor the conservation status of natural habitats.
Each habitat is evaluated, at the level of a parcel, according to three criteria which are its structure, its composition and its degradation.
For each of these criteria, we evaluate a list of indicators. These indicators are different from one habitat to another.
The structure of the form is :
- loop into a parcel list of id (select_one)
- select the habitat to be evaluated
- loop into the list of "structure" indicators to fill the value
- loop into the list of "composition" indicators to fill the value
- loop into the list of "degradation" indicators to fill the value
- select the habitat to be evaluated
We first tried to use dynamic repeat-count, and the ability to hide previously selected values in the pick list. This works fairly well but can be a source of discomfort or error when moving backward into the form.
So we looked for another way. Since we know how much indicators I have to fill for each criteria for each habitat, we use this value as repeat_count, and we added a "rank" column (from 1 to n) for each habitat and criteria, in order to filter it with choice_filter
habitat=${habitat_n2k} and rang = ${rang_stru}
At the end of the loop (using repeat_count) We jump to next criteria and so on.
It is less dynamic than the first scenario but probably more robust in term of backward navigation.
What we would like to do to complete this form is to reset all values relative to an habitat patch if the user goes backward and changes the habitat at the beginning of the form.
We tried to use triggers possibilities but we don't completely succeed. I wondering we just needed to ask collect to trigger when habitat changes but it is not sufficient for all the input.
It is OK to refresh the numbers of indicators for the new habitats and refresh the list, but we can't achieve to refresh/modify the repeat count. If the habitat we selected first need 3 indicators for the structure criteria, when we change to an habitat concerned by only 2 indicators, ODK will show a third "empty list" of indicators, as if the number of indicators was not refreshed by the trigger.
Here is a simplified version of the form (only the first criteria), without any trigger.
etats_conservation_hbt_n2k_forum.xls (31 KB)
thanks a lot for reading this long story