How to access preloaded csv choices not selected in repeat question

What is the problem? Please be detailed.

I have a repeat question that select ('search') and access (pulldata) previously collected data from a csv file. I am already restricting selection of already selected options in previously questions. At the end of the looping question, after all items from current census were selected I need to access items not selected. For each ot them (not selected) I will need to ask some questions, different from previous loop.

The xls is something like this:

type | name | calculation | constraint | appearance|

calculate | tag_selected | join(' ', ${tree_tag}) | | |

begin repeat| tree_rept | | | |
calculate| position | position(..) | | |
calculate| so_far | if (${position} = 1, '~', once(substr(${tag_selected}, 0, string-length(${tag_selected}) - string-length(${tree_tag})))) | | |
select_one tag | tree_tag| |not(selected(${so_far},${tree_tag})) | minimal search(‘peic09’, ‘matches’, “quad”, ${quadrat}) |

What ODK tool and version are you using? And on what device and operating system version?
I am using a note 8 samsung with android 8.0.0

What steps can we take to reproduce the problem?
Find the xls form at https://drive.google.com/file/d/1sqjD_6FP4d1wYe5q8EJHG2mHj-1z38mI/view?usp=sharing

What you have you tried to fix the problem?

I have tried several ways to reach this goal. Mostly using the choice-filter with 'not(selected())' options. I have tried to selected all possible choices at the begging of the form using default field without success. I believe if I can access all options in csv file I will be able to filter it by the variable with all selected options (${so_far}).

Hi Hélène,
I am pretty new in this forum and I start to design my first odk forms a few weeks ago. Sorry to ask you directly but it is very close with our answer here.
I am implementing a xml form for trees census in a neotropical forest plot. We have about 40 thousand already tagged and mapped trees. I am uploading previous census data to select the tag in a 'select_one' question type using appearace search("file", ) restricted for a subplot. And after that pulling data from the previous census to check for errors before collect new measures. During the field work we delimited a subset of the plot to work in order to do not miss any tree (20x20 and 5x5m inside it).So, I search for tree tags for each subplot. My question is: I need to show for the user what are the "tree tags" that are not selected at the finish of the repeat tree tag. So, is a kind of what you show but I need to have show only the not selected tags from a subset of csv file data...
My xls form is in:

Thank in advance...

I have a very similar question. How to return a list of select_one questions in a repeat loop, so at each iteration the previously selected data do not show, so at each interactions the choices are n-1 from previously number of choices...

Hi and welcome, @aleadalardo! When you get a chance, please introduce yourself. In general, it's better to post a new topic when your question is not identical to a previous one.

I don't use the search() appearance/function myself so I don't have an exact answer for you but you should be able to use the so_far value you've introduced in your form as an additional filter. You can see here and especially 6 near the bottom for ideas.

Hi Hélène,

Thank you for your help. Is very nice of you answered so quickly. I have been searching forum and other odk documentation and you are a very constant presence helping people. I really appreciated it. Besides that, I like the way you answer questions, it clear and directly to the point.

I am almost given up to set up the form as I would like. Seem to me that no one have the same issue and for me sounds like a very simple one and I can not find a soluction. I just need acess the choices not selected in a repeated questions. It is really fustanting.

I have tried several ways in choice_filter using "not(selected(..." approach and it not works. I tried a simple "name != ... " for a single choice and this do not work too for csv source data.

I tried to figure out how the choices from a answer (from source(file.csv)) are stored in the xml form, but neither this I found. After several tries I tried another way: selecting all choices as default from a previous select_multiple question and store it as a variable... Unfortunable the default column in a xls do not work for pulled data from csv files...
Any way, thank you for the help.

Best,
Alexandre

1 Like