ERROR: Only questions and regular group are allowed in 'field-list'. Bad node

I am getting an error when running it on ODK Collect App. What seems to be the problem?

Thank you for your help.

Hi @Makino
the problem is that you are using repeatable groups inside a group that is displayed on one screen (field-list appearance). We don't support such a case. Repeatable groups can't be displayed on one screen. Probably you expect having a button to add new groups and expanding the page every time a new group is added?

Yes, but how can I group them on one screen?

It's not possible to display all repeated groups on one screen. If it's something you find useful please create a topic in Features and describe your case.

1 Like

@Makino, you can share your full xls form here so other can do testing on it.

If repeat is definite then it might be a good feature to have all repeat questions in one screen.

Case1:

Screen 1: Number of Household Member (Say 3)
Screen 2: Creates 3 repeat on the same screen to input household member's information.

Additional Feature: In case member is more than 3 and user does not want repeat questions in one screen then it might be helpful control appearance "field-list" for example making field-list action "false".

Case2:

Screen1: Number of Household Member (Say 3) and creates 3 repeats in the same screen to input household member information.

Yes I understand it might be useful in some cases. In the future we might want to implement something like I described in Building a table or matrix for a set of questions on XLSForm but we don't have specific plans yet.

1 Like

Hello,
[Grzesiek2010, post:2, topic:30390"]
"Repeatable groups can't be displayed on one screen."
May I propose to put this restriction in the ODK documentation.
Thanks.

Definitely, I was sure such a note exists in the docs but can't find it now.
I filled an issue https://github.com/getodk/docs/issues/1267

1 Like

Thank you for the information. Sorry for the late revert as I am away from keyboard. :slight_smile:

1 Like

Just a follow up question, REPEAT GROUPS can now be viewed in one screen using field-list appearance? I just tried it today! :slight_smile:

It has been always doable to display a repeatable group on one screen using field-list appearance. What is not possible is to add a normal group with field-list appearance and put a repeatable group inside. Then it throws an error because if it was possible you could for example put more than one repeatable group in a group that is displayed on one screen what would be difficult to handle from the perspective of UI.

So I ran across this today, and it struck me as a bit odd... Strictly speaking, it appears legitimate - at least in terms of XForms/XLSForm spec - to indeed have a repeat group inside of a group with a field-list appearance. Specifically, the XLSForm spec says nothing about excluding such, merely...

In your form, you can use the field-list appearance on a group to display multiple questions on the same screen.

That is to say, the field-list appearance is basically just a UI preference to the XForm client to display everything on the same 'screen' [sic]. Indeed, the Enketo web client supports it quite happily; eg the following (XLSForm) form contains a field-list group with two repeat groups inside it, and it is rendered in the web UI as:

RepeatFieldList.xlsx (18.5 KB)

However, as noted previously, ODK Collect will throw a runtime warning if you attempt to use this form:

Indeed, the docs specifically state this isnt permissable, with a warning:

You can apply the field-list appearance to a repeat to make all of the repeated questions go on a single screen. However, you can't have a repeat inside of another group with the field-list appearance.

However, strictly speaking, this is only the case for the Collect app (again, probably for the reasons @Grzesiek2010 alluded to).

What's rather interesting is that if you do actually attempt to do this, as shown in the above Collect snapshot, Collect actually proceeds to happily present the second nested repeat group's question(s) in the field list group (!?), completely skipping the first nested repeat group; that seems very odd indeed...

I think if Collect cant reasonably support repeat groups within field-lists then ideally we probably shouldn't let the user even start the form, or preferably even throw an error when they try to download such a form. I dont think exhibiting odd behavior when Collect eventually hits a repeat group nested within a field-list is desirable.

We should also probably relax the documentation to indicate this is Collect UI-specific behavior, which doesn't affetc Enketo web clients.

2 Likes