Add New Group: Add initial group automatically

xlsform

(Ayub) #1

Dear All,

I am using XLS form and would like the first repeat of the group to be entered in without asking ADD New Group.

In the generated XML when i deleted jr:template="" to the repeated questions group, I got exactly what I needed, but is there a place in XLS where I can specify this.

Thanks for the help!

Regards,
Ayub


(Maya.zahabi) #3

Hello !

I was having the same issue with this. The reason for the add new group pop up only happens when the repeat rule is written under the relevant column. When i moved the repeat rule to the repeat_count column, the pop up no longer showed up and it became automated (XLS coding)

Hope it helps !


Erasing the question of Add New Group in ODK Collect on repeat
(Ayub) #4

Hello Maya,

I am reaching again on this topic after some time, can you share an XLS example so that I have some better idea or have some resources on the internet to look over?

Thank you so much !


(Hélène Martin) #5

@Maya's suggestion is to use a repeat count as described in http://xlsform.org/#repeats. You can ask a question with something like "How many friends do you have?" and then use the value entered as the count. That's my preferred way to work with repeats when possible.

@Ayub do you have a sense of how you would like to indicate in the XLSForm that you don't want jr:template? I see two options:

  • only include jr:template if one of the fields in the repeat has a default
  • add a directive to the parameters column such as template=yes (current behavior) or template=no (no jr:template)

(Ayub) #6

Helene,

Thanks for detailed reply, first part is clear, however, when i tried to implement "parameters" column for "no jr:template", I still face the same problem i.e. "Would you like to add another group?", did you meant to implement it as in the screenshot below?

Thanks !


(Maya.zahabi) #7

@Ayub here you go, hope it helps !![


(Maya.zahabi) #8

Additionally, i noticed your type of question appears to be "begin repeat" when it should be "begin_repeat". Maybe look over the types of questions allowed here: http://xlsform.org/#question-types


(Ayub) #9

Maya,

Thanks for your answer, I got it regarding the repeat counts! checked the docs at XLSForm, I believe it is "begin repeat" instead of "begin_repeat" (under the repeat section)

http://xlsform.org/#repeats


(Hélène Martin) #10

Both begin repeat and begin_repeat are allowed!

I'm sorry, my question was unclear. There is no such capability in XLSForm now. I meant to ask for feedback on a future XLSForm feature that we could add to avoid jr:template. Do you have thoughts on how you would like for that to work?

Like I said, I do like using a count and that solves most repeat problems. However, sometimes enumerators don't know ahead of time how many repetitions they will need and it would still be useful to be able to ask the repeated questions once before prompting to add more.


(Ayub) #11

Yes, the problems are dynamic repeats, for instance "people living in a household", most enumerators would like to have them listed at the run-time rather than to enter # of people in the household first (as repeat count) and then proceed with the roster.

I would really like some option under "appearance" perhaps? like appearance = "no-template" or appearance = "template"

I understand defining these will involve going deeper in the code, but can you guide me to some relevant resources, that would be great.

Thanks!


(CRoy) #12

Hello guys,
I come back on this discussion because I have a similar problem. (Should I restart a new discussion?)
I have a repeat in a form wich have default values in the repeat loop.
I would like to add the first group automatically.
It works well in deleting jr:template="" but the default values are only on the first loop and disapear on the others.
By the way, the user don't know how many repeats he will do so I can't use the repeat count...
If you know a solution, I'll take it !
I have an another question related to this "Add New Group", can we modify theses words? e.g. "new species" instead of "new group"?
Thanks in advance,
Cédric