Repeat sections

Understanding exported data - Repeat sections

If your templates use repeat section, you may want to link data between or across multiple sections.

To understand the data involving repeat sections, it's important to understand the structure and concepts of repeat sections to see how they work.

There are 3 key item types:

  • dynamicfield / Repeat section: This is the repeat section itself.
  • primeelement: This is the "template" for any items/questions added when adding a new repeat section. This is not visible when conducting inspections.
  • element: This is an instance of the prime element. This is what you see when conducting inspections.

Consider the following example of repeat sections.

Example of repeat sections

This data appears as follows when exported

item_idparent_idtypeprimeelement_idprimeelement_indexlabelresponse
aaaazzzzdynamicfieldMy Repeated Section
bbbbaaaaprimeelementbbbb
cccccccctextsingleccccMy Repeated Text
ddddddddquestionddddMy Repeated Question
eeeeaaaaelementbbbb0
ffffeeeetextsinglecccc0My Repeated TextText for 1
ggggeeeequestiondddd0My Repeated QuestionYes
hhhhaaaaelementbbbb1
iiiihhhhtextsinglecccc1My Repeated TextText for 2
jjjjhhhhquestiondddd1My Repeated QuestionNo
kkkkaaaaelementbbbb2
llllkkkktextsinglecccc2My Repeated TextText for 3
mmmmkkkkquestiondddd2My Repeated QuestionN/A

As a tree the structure looks like this.

dynamicfield - My Repeated Section (id: aaaa)
├── primeelement (id: bbbb)
│   ├── My Repeated Text (id: cccc)
│   └── My Repeated Question (id: dddd)
├── element (id: eeee, primeelement_id: bbbb)
│   ├── My Repeated Text (id: ffff, primeelement_id: cccc)
│   └── My Repeated Question (id: gggg, primeelement_id: dddd)
├── element (id: hhhh, primeelement_id: bbbb)
│   ├── My Repeated Text (id: iiii, primeelement_id: cccc)
│   └── My Repeated Question (id: jjjj, primeelement_id: dddd)
└── element (id: kkkk, primeelement_id: bbbb)
    ├── My Repeated Text (id: llll, primeelement_id: cccc)
    └── My Repeated Question (id: mmmm, primeelement_id: dddd)

The primeelement_id will always be identical for the same question across different elements/repeat sections.

primeelement_index increments from 0 and is the index of the element in the repeat section. Questions under the same element will have the same index.