Skip to content
commcare nova

Split a form into sections

Page a long form so people answer one part at a time, with each page checked before the next.

A long form is easier to fill in one part at a time: the questions about the person, then the visit, then what happens next. A section is one of those parts. On a phone each section is its own screen, with Next and Back; the app checks a screen's answers before it turns the page, and a page with nothing to show is skipped.

Where to find it

Open a form. The "+" between two questions offers Split into sections here under Structure: the questions above it become the first section and the questions below it the second. Once a form has sections, the "+" between two sections adds a section, and the "+" inside a section offers Split section here, or New section after this one at its end.

Every section has a heading on the canvas, Section 1 of 2 and so on, with a title you edit in place the way you edit a question's label. A title can be left blank; the heading still shows which page it is.

Select a section's heading for its settings. Merge with previous section joins two pages into one. Remove section only takes the page away and its questions join the section beside it, or return to the form as a single page when it was the last section. Delete section and its questions removes both, and asks first. Move up and Move down reorder the sections.

When removing sections would put two questions with the same identifier on one page, Nova asks you to rename one before combining them.

What a sectioned form keeps true

Once a form has sections, every top-level item is a section: a question cannot sit between two pages, because the app would have nowhere to show it. Nova keeps that true for you. Dragging a question onto a page lands it there, and a move that would leave a question outside every page is refused with the reason.

Two more rules come from the device. A section is always at the top level of a form: a page inside a group would just be a group, so Nova offers the gesture only there. And a repeat that people add entries to cannot sit on a page, because a phone cannot add entries on a screen that shows several questions at once. The same holds inside a group shown on one screen. Fixed-count repeats, case-query repeats, and groups can sit in either.

Counted repeats read their current count when you reach the page and as answers change. Increasing the count adds rows; decreasing it keeps rows and answers already created. The count can read an earlier answer or an answer in the parent row, but cannot depend on the rows it creates.

A record-query repeat takes its list of matching records when the form opens when its search reads no answer, it shows on no condition of its own, it sits in no other repeat and no group around it shows on a condition that can change while the form is filled in. Otherwise its rows follow the search as the form is filled in: each row keeps its place, so its answers stay with that place when the results change, and a row past the end of the results is hidden and not submitted. Nested record-query repeats follow their search, so they can use answers from an earlier page. Preview creates a section's rows when you first reach the page, and returning to a page keeps them.

Nothing is permanent: removing the last section returns the form to a single page with its questions in place, and you can undo any of it.

In Preview

In Web Apps, every section shows on one page as a titled group. When Preview runs as Android, it runs the form the way a phone does: one section per screen, a Sections strip showing where you are, Next and Back, and Finish on the last page.

  • Next checks the questions on the page first. A required question left blank, or an answer a rule refuses, keeps the page and takes you to that question.
  • Back never checks anything, and keeps what you answered.
  • Choosing a later section in the strip checks every page on the way. An earlier one opens straight away.
  • Leaving a page saves the day shown in any visible date picker the worker hasn't answered or cleared. If that answer reveals a section, Next opens it in order and a jump checks it before moving on.
  • A section whose questions are all hidden by their display conditions, or that has no questions yet, is skipped, and the count leaves it out.
  • Finish checks the whole form. If an earlier page has a problem, Preview turns to it and shows you the question.
  • Clear form starts again on the first page.
  • After a successful submission, the next entry starts on its first visible page, including when the app opens another form automatically.

After you turn a page, screen readers hear its position and title and focus moves to its heading. Clearing or reopening the form retires that feedback from the previous entry. An automatic page change also clears the previous announcement. When an answer needs attention, Preview moves focus to that question. If you start editing another answer first, focus stays where you’re working.

If case data refreshes while Preview checks a page, Preview keeps your entered answers and stops that page change. Once the form is ready, you can choose Next, a later section, or Submit again. Preview does not repeat the interrupted press automatically or ask you to correct an answer it could not finish checking.

Flipping between editing and Preview keeps the page you were on, and the heading you were looking at stays where it was.

On a device

CommCare on Android, and the one-question-per-screen mode of Web Apps, page a form exactly this way. Web Apps' default view shows the same form on one screen, each section as a titled group. The answers and the rules are the same either way; only the paging differs.

Counted repeats can read an integer answer from an earlier page. Increasing the count adds rows when you enter the repeat. Decreasing it keeps rows already created, including their answers and any record updates when you submit. For rows that workers add and remove freely, use a worker-added repeat.

Place a question and its answer separately

A visit form can ask for a phone number on its first screen and keep the answer in the contact details group used by your reports. In the question's Field actions, choose Place question on screen to move its prompt, or Place submitted answer to move its saved value. When you move a question on screen, choose a group and the item it should follow. Use First to put the question at the start of that group. When you move the submitted answer, choose its group. Nova uses the answer order that CommCare HQ’s form builder keeps.

A worker sees the question when both groups apply to this visit. If the group holding the saved answer applies but the screen group is hidden, the form can still submit its starting value. If the saved answer’s group is hidden, the form leaves that group out of the submission.

In a repeat, the prompt and the saved value belong to the same entry. Moving a saved group also moves the addresses of its answers. An app brought in from CommCare HQ keeps both the worker's screen order and the saved answer order when you edit the wording.

A worker test can add or remove repeat rows while the repeat is reachable. On Android, the worker passes the questions before an invitation to add an entry. An existing entry keeps its answers while a condition hides the repeat.