Refer to information in nested roster

Dear Survey Solutions Team,

I have the following rosters:

Level 1: Parcel Roster (proster, numeric roster)
Level 2: Plot Roster (ploroster, list roster)
Within Plot Roster: MCQ (cropsonplot) [Which crops do you grow on plot %proster%?]

The problem is as follows:

In a next, different section, I would like to ask about the sales by crop. To this end, I (try) to use a Fixed Item Roster with all possible cropcodes. I only want those crops to show up, that have been selected in the MCQ’s (cropsonplot) on any plot on any parcel.

If I try to address this roster (cropsonplot) I of course receive the error message that the roster does not exist in the current context. But unfortunately I do not know any command how to refer to this nested roster. Could any of you help me out?

According to the public example, the LSMS Team circumvent the problem by asking again all the crops that the farmer has planted but I would like to avoid that.

Best,
Peter

Peter, try a variation of this:
PLOTS.Any(p=>p.CROPS.Any(c=>c.CropCode==@rowcode))
you may need a typecast depending on your CropCode variable, and perhaps more layers as I don’t see a crop level in your outline above.

Also you can try turning the table and ask What are all crops that you grow? first, then filter the choices for the crops selectors in each plot. And of course reuse this later for the disposition or consumption section.

Best, Sergiy

Sergiy,

thanks for this timely support!

Your proposed solution works very well. I therefore stick to my structure, even though your proposed alternative could have done the trick as well.

Best,
Peter