Select multiple values, loop and output

Hi all,

I am creating a form that is asking farmers for a list of crops they grow, then asking questions about each of those crops. My intention was to have a select multiple field with all of the crops, then have a loop for each of those selections. I have that working.

What I need now is to be able to base 'relevant' criteria for questions within the loop on what crop the loop is currently dealing with. That is, if the crops chosen are wheat, corn and carrots, I want certain questions within the carrots loop to be omitted.

Is there a way to refer to the 'carrots' value? Something like

  <bind nodeset="/data/D7_loop/D7_TO_BE_OMITTED" type="string" relevant="(selected, 'jr:choice-value(/data/D7_loop/D7_position, '/data/D6')'" />

Obviously the above doesn't work, but that's the direction I'm trying to head. Any pointers would be appreciated...

Thanks

In case this is useful to someone else... I (sort of) ended up solving this in a bit of a roundabout fashion. I used a rather awkward relevant criteria as follows:

relevant="(/data/D7_loop/D7_name = 'Amaranth' or /data/D7_loop/D7_name = 'Apoth (jute mallow)' or /data/D7_loop/D7_name = 'Bell pepper' or /data/D7_loop/D7_name = 'Butternut' or /data/D7_loop/D7_name = 'Cabbage' or /data/D7_loop/D7_name = 'Carrots' or /data/D7_loop/D7_name = 'Chili Pepper' or /data/D7_loop/D7_name = 'Coriander leaves (dania)' or /data/D7_loop/D7_name = 'Cowpea leaves' or /data/D7_loop/D7_name = 'Dek (Spider plant)' or /data/D7_loop/D7_name = 'Eggplant' or /data/D7_loop/D7_name = 'Mitoo (Slender leaf)' or /data/D7_loop/D7_name = 'Onions' or /data/D7_loop/D7_name = 'Osuga (Black nightshade)' or /data/D7_loop/D7_name = 'Pumpkin fruit' or /data/D7_loop/D7_name = 'Pumpkin leaves' or /data/D7_loop/D7_name = 'Spinach' or /data/D7_loop/D7_name = 'Sukumawiki (Kale)' or /data/D7_loop/D7_name = 'Tomato' or /data/D7_loop/D7_name = 'Watermelon')"

So it's checking for each string value instead of the underlying data value. It's ponderous, but it works...

ยทยทยท On Tuesday, April 5, 2016 at 3:08:34 PM UTC-6, colind...@gmail.com wrote: > Hi all, > > I am creating a form that is asking farmers for a list of crops they grow, then asking questions about each of those crops. My intention was to have a select multiple field with all of the crops, then have a loop for each of those selections. I have that working. > > What I need now is to be able to base 'relevant' criteria for questions within the loop on what crop the loop is currently dealing with. That is, if the crops chosen are wheat, corn and carrots, I want certain questions within the carrots loop to be omitted. > > Is there a way to refer to the 'carrots' value? Something like > > > > > > > > > Obviously the above doesn't work, but that's the direction I'm trying to head. Any pointers would be appreciated... > > > Thanks