How to list selected items which are in a loop into a another question question which is not in a loop

How do i list items which are in a categorical question in a loop into another question which is not in a the loop.

For example:
Q1. How many stoves did you use: 3
Q2. Which type of stove is this

  1. Type 1
    2.Type 2
  2. Type 3
  3. Type 4
  4. Type 5

Q2 should be iterating based on number in Q1.

All the stoves which have been listed listed in Q2 are the only ones that should appear in Q3. In my case i selected
Type 3 in first looping
Type 2 in second looping and
Type 5 in third looping

Q3. Which stove do you use most?
Type 3
Type 2
Type 5

How do i accomplish this. Attached is what i have tried and it is not bringing the desired output.Haiti V04_2_support.xlsx (15.1 KB)

@yanokwa how can i do this?

Hello @yanokwa I am having a problem with index repeat function. I want to list categorical answers which have been selected in a loop in a different question. I have use the following code :indexed-repeat(${HC3}, ${stove}, 1) and indexed-repeat(${HC4}, ${stove}, 1)
indexed-repeat(${HC3}, ${stove}, 2) and indexed-repeat(${HC4}, ${stove}, 2)
indexed-repeat(${HC3}, ${stove}, 3) and indexed-repeat(${HC4}, ${stove}, 3)
indexed-repeat(${HC3}, ${stove}, 4) and indexed-repeat(${HC4}, ${stove}, 1)
indexed-repeat(${HC3}, ${stove}, 5) and indexed-repeat(${HC4}, ${stove}, 5)
indexed-repeat(${HC3}, ${stove}, 6) and indexed-repeat(${HC4}, ${stove}, 6)
indexed-repeat(${HC3}, ${stove}, 7) and indexed-repeat(${HC4}, ${stove}, 7)

Where HC3 and HC4 are my target variable in the loop and ${stove} is the repeat_name. What might be missing? Kindly help

Haiti V04_2_support.xlsx (15.4 KB) This is what im trying to do.

Hi @smbai

I'm not sure if I understand so to clarify... you want to create a list of items in order to use in select-one question based on items selected in a repeatable group?

@Grzesiek2010 Thanks for your reply. Yeah. Just to amplify. What i want is to list the items selected in repeat groups in HC3 and HC4 in a select-one question.

What do you mean by HC3 and HC4? Could you add a good sample?
If you select Electric stove in HC3 and NAME/BRAND 1 in HC4 in your first repeat group you expect to create an option for select one like Electric NAME/BRAND 1?

Yeah. That is what i want. I am attaching an xls.Haiti V04_2_support.xlsx (19.2 KB)

Or if we can list the items in HC3 only it will have almost sorted my problem partially and i'd appreciate.

Please test this edited form. If it's what you need I'll explain how i achieved it:
testY.xml (10.8 KB)

Hello @Grzesiek2010. I can't open the file. Can you resend it please?

You can try again:
testY.xml (10.8 KB)

Can you try sending it as an excel file please:pray::pray::pray:? I am having the same problem opening it.

What is the problem? Can't you download it? I can't send xls version because it's a tricky case which requires one change in xml file after converting it.

Unfortunately Yes. I can't download it.

So maybe this way

@Grzesiek2010 Thanks for helping. It is still not uploading. Can we abandon the whole code i.e indexed-repeat(${HC3}, ${stove}, 2) and indexed-repeat(${HC4}, ${stove}, 2) and deal with one item i.e indexed-repeat(${HC3}, ${stove}, 2) and try introducing jr:choice code to see if it can work in xls format? Your help will be highly appreciated.

What do you mean? Did you save it to xml file?

Yeah. I saved it as an xml file.

I think we can have a work around if we want only work with this code and incorporate jr:choice