About using begin repeat

1. What is the problem? Be very detailed.
I am trying to use questions inside begin repeat block once first, then again if a condition in a relevant column is satisfied. For the xlsform included below, I want to collect data on breast cancer details in a single breast first and repeat for another breast only if ${contralateral}='yes'.

2. What app or server are you using and on what device and operating system? Include version numbers.
I am using https://getodk.org/xlsform/ to render the form.

But I get this message:

Repeat behavior has changed. Previously, some clients like ODK Collect prompted users to add the first repeat. Now, the user will only be prompted to add repeats after the first one. Representing 0 repetitions will require changing the form design. Read more at http://xlsform.org#representing-zero-repeats.

In the enketo rendering which I get, I don't get questions in that repeat block at first. I get it only when I select contralateral=true. How to get that block initially first and again only if contralateral breast has also breast cancer?

3. What you have you tried to fix the problem?

4. What steps can we take to reproduce the problem?
xlsorm is attached below. Anyone can upload the form in xlsonline and see.xlsform_template.xlsx (24.1 KB)

5. Anything else we should know or have? If you have a test form or screenshots or logs, attach below.

Hi Suman Khanal,

I doubt that I understood your problem. However, an approach I have designed for you here. If this best fits your current need you can apply this in your full-fledged form. Please have the attached xls file.Test Cancer.xlsx (10.9 KB). If you don't set relevance for repeat, single repeat is displayed, so you can click plus sign if you wish to display repeat questions again. As far as I went through your whole questions, you need to group questions and use 'field-list' appearance to display multiple questions of a group in a single ODK Collect page or screen.
You can contact me for free service in this crisis.
Raj

Hi Raj,

Thanks for reaching out for help. Let me make clear what I want to achieve:

I am planning to collect comprehensive longitudinal data on breast cancer. Most of time patient present with breast cancer on only one side. For that I want to collect all variables inside begin repeat block. For most of the patients this is fine.

But for some patients they present with abnormalities on contralateral (other breast) side too. Instead of making new questions, I want to use the same variables inside the begin repeat block again.
As such I have to set relevant column, to repeat only if disease present on contralateral breast.
This is what I want to achieve. Any help?

Thank you

Hi Suman,
Please try this form from Helene Martin, a very active ODK expert in this forum. This approach has used option for next repeat from inside the same repeat, in the repeat count. But one thing I don't like this in this approach is that, once you go for next repeat, displayed repeat questions are not hidden if you wish to go back. best of luck.
Raj

Hi @sumankhanal
welcome to the forum! Please introduce yourself here!

If you want to solve your problem using repeats I think you need something like:
repeatForm.xlsx (6.5 KB)
however, I'm not sure because as I understand you need up to 2 groups of questions so maybe it would be easier to have two duplicated groups without using repeats (in terms of logic used to create the form), but yeah both should work so you decide what's better for you.

That worked. Thank you.