Read from file a list of names to use in select_multiple

Dear Community

I am building a form, where I first ask the user ID and depending on this, the content of following questions is different. Since there are hundreds of users I store the data about the content of following questions in a file. The file is pullparcelcontent.csv header of the file is the following:
userID; countrydata; seeddata; seed1; seed2; seed3; …; seed10
1; France; a b d n w r t c a j; a; b; d; …; j
2; Germany; k g n a x t c o s w; k; g; n; …; w

In practice, the users are based in different countries and receive a unique selection of seeds and sow them in their garden.

As you may notice, the seeddata column is just a concatenated version of seed1, seed2, etc

The form has two aims:

  1. check if they received what I intended to send them (no packaging error)
  2. ask them to tell me in which order they sow the seeds to the 10 available spots they have

Aim 1. I can achieve as:
type name label calculation
integer userid Give your user ID
calculate parcel_content pulldata(‘pullparcelcontent’, ‘seeddata’, ‘gardenid_key’, ${userid})
note parcel_check The content of your garden should be ${parcel_content}. Check your seeds against this list it!

Aim 2. I am not sure how to read the columns seed1, seed2, etc as a list so I can use it in a select_multiple embedded in a repeat. The repeat count is 10, so they go through the 10 available spots and for each select a seed that they have sown there.
type name label repeat_count calculation choice_filter relevant
begin_repeat seeding_spots Choose from the list of seeds for each seeding spot! 10
select_multiple seed spot1 Which seed did you put at seeding spot 1?
select_multiple seed spot2 Which seed did you put at seeding spot 2? selected(?)


Q1: I am not sure how to read the columns seed1, seed2, etc to the name seed. I also tried select_multiple_from_file but again I could read one column at once only. Note that in reality I have more than 10 seeds.

Q2: I am also not sure what is the best way to reduce the seed list after each selection to the remaining seeds, maybe with selected() but again this would lead to very lengthy conditions?

I am looking forward to hearing from you with hints and solutions!


Welcome to the community, @Tika! Did you mean you wish to list the choices from the CSV file to a select_one or select_multiple question type (within or outside the repeat group)? Correct me if i understood your issue incorrectly.


I try to re-phase the issue: how to design the series of 10 questions to pair-up the 10 different seeds with the 10 available spots in the garden.

Thanks for your time!

@Tika, I am still not quite sure how you have structured your CSV file. Could you kindy share a screenshot of your sample CSV file, please?