Cascading select_answer all

1. What is the problem? Be very detailed.
Made a questionnaire to collect information about trees. Each plot has different number of trees. E.g. Plot one, 6 trees (a, b,c,d,e and f), Plot two, 5 trees (a,b,c,d and e). We visit these trees on a weekly basis. Using the cascading selects I made lists of trees for each plots. After few months I realized that my team mates miss some trees. E.g. Plot 1 a, b,c,_,e and f= they missed tree 'd'). I want my field teams to collect data for all the trees

2. What app or server are you using and on what device and operating system? Include version numbers.
I am using ODK collect v1.27.2, connected to my google account.

3. What you have you tried to fix the problem?
I used the following link for earlier support- Choose one from a list and get another choose one list
4. What steps can we take to reproduce the problem?

5. Anything else we should know or have? If you have a test form or screenshots or logs, attach below.
https://enketo.getodk.org/preview?form=https://xlsform.getodk.org/downloads/hcz5pvlu/ChittoorTrees.xml
Here is the link to the form that I am using.
Observation date*
Site name*
Site code*
Plot Information
Tree code* (is automatically generated but field teams miss some trees) I want make sure that they answer all the trees before they submit)

https://enketo.getodk.org/preview?form=https://xlsform.getodk.org/downloads/hcz5pvlu/ChittoorTrees.xml
Here is the link to the form that I am using.
Observation date*
Site name*
Site code*
Plot Information
Tree code* (is automatically generated but field teams miss to enter data for some trees). How can I make sure that they answer all the trees before they submit?

Hi @Saneesh,

Checkout the below post, i think it can solve your challange

I tried but it didn't work.
Please see the xls file.AnantapurTrees.xlsx (23.1 KB)

Hi @Saneesh,

See the sample form, ajeNKWU4x65MPSBDeEb3P8.xlsx (10.2 KB) . This is the idea behind. See how you can adopt it.

Hi @dicksonsamwel Thank you for your suggestion and when I tried your suggestion, but I get an error message saying "value not allowed" when I try to answer "tree_code". AnantapurTrees.xlsx (23.1 KB)
I am not an expert in computer and I made the form that I am using right now with the help of lot of searching in this forum.

Thanks a lot for your time.

The problem is in your constraint you have there:

if(${tree_code} = position(..) and count-selected(${tree_code}) > 0, true(), false())

you try to compare ${tree_code} = position(..)
where ${tree_code} answers are like:

1060-Cassia fistula
1061-Wrightia tinctoria
1062-Dolichandrone atrovirens
1063-Dolichandrone atrovirens
1064-Dolichandrone atrovirens

etc
but position(..) returns just numbers.

@Grzesiek2010 are you suggesting to remove the -scientific name of the plants and keep on the tag numbers (1060, 1061, 1062, etc.)?

Thank you
Saneesh

No it still wouldn't be enough. position(..) returns numbers like 1,2,3 etc and you try to compare it with 1060-Cassia fistula or even 1060 if you drop the -scientific name, it will always return false.
Could you explain what your are trying to achieve with that constraint?

@Grzesiek2010 I want my team mates to collect data for all the species, they have missed tagged trees. If they miss one trees I will not get data of the same.

Thanks.

I understand but what about that particular constraint?

if(${tree_code} = position(..) and count-selected(${tree_code}) > 0, true(), false())

did you create it? I was asking what you are trying to achieve there.

Hi @Grzesiek2010,

Just to assist here, refer to the previous threads, the constraint was originally used from the sample form that I provided. I provided the form to see the idea behind. So basically with that constraint, the user will be forced to select each select one item basing on their position and the repeat number, ensuring each item is selected.

Ah ok I sees so as I said above that constraint will always return false, to fix it you need to convert (name column in choices sheet):

1060-Cassia fistula
1061-Wrightia tinctoria
1062-Dolichandrone atrovirens
1063-Dolichandrone atrovirens
1064-Dolichandrone atrovirens

to numbers 1,2,3... then you can compare it with position(..).

@Grzesiek2010 thank you for your support but I am afraid it might lead to other complication, I would rather make sure to collect information for all the trees by keeping a hard copy of the check list of trees. Thanks again @dicksonsamwel and @Grzesiek2010

Hi @Saneesh,

I have a suggestion for you. Since the loop is dynamic, you can make the form such that you have a defined loop number, depending on the trees. Since you have number of trees in the text, you can change it a bit to allow to fetch that number dynamically. So, instead of (10 trees) , you can change it to --10, so that to fetch it using substring-after function. That means the repeats will be added automatically. See the form AnantapurTrees (1).xlsx (34.0 KB)

After if you wish to check for duplicates and restrict it, check this thread