Controlling REPEAT count


I have put an image question in REPEAT loop, and want the user to take minimum 1 and maximum 3 images. With current repeat behaviour, minimum 1 works fine, but I am unable to end the loop after max 3 limit is reached. The examples I saw just show a warning message to the user to adjust images if they are more than limit, and he can still move forward without adjusting it. But I don't want to leave this in the hands of the user.

Is there a way to control it?


Hi Saad,

It could be possible to fix the repeat loop at 3 times but add some logic within the repeat loop that would make only the first image mandatory. You would need to use a CALCULATE with the position(..) function to determine where you are in the repeat group. Then you could either have:

OPTION1: a REQUIRED column with a formula like "if(${position} = 1, 'yes','no')"

OPTION2: a SELECT_ONE question (yes/no) which appears on the second and third repeat only with a relevancy that states "${position} > 1" and asking if the user wants to take an additional photograph. The photo question itself would then have a relevancy of "${position} = 1 or ${additional_photo} = 'yes'". It would be required at all times but dependent on a relevancy.

Both options would work and maintain just one question related to photographs so I guess it depends which option works better from a user perspective.

OPTION3: There is a third option which is simpler but means having three questions asking for a photo and no repeat group. Questions 2 and 3 not being required and Question 1 being required.

This is definitely the easiest option. It means that there will be 3 separate columns in the data export with the names of the media files but it also means that they wont be on a separate excel sheet as the repeat group would be avoided entirely.