Navigating a Form
Forms in Survey are defined in HTML, CSS, and JavaScript. A default look-and-feel, along with an extensive selection of prompt widgets, is provided by the ODK-X framework, but this can be customized by your organization.
To navigate forms using the default look-and-feel:
Tap on the name of the survey in the top left to access a pop-up menu of options.
Tap the Back or Next buttons in the top right of the form to navigate through the form.
Let's fill out the instance of the Example Form that we opened in the previous section. After tapping the Create new instance button you should see the following screen:
Use the Next button in the top right to progress to the first question.
Initial Value
This prompt asks you to give the form an initial rating. Its purpose in this example is to show how Survey can use previously collected data to populate and calculate later fields. Enter any number you like and it will be used later.
Press the Next button in the top right to progress to the next question.
Prompt Selection
This prompt allows you to choose which sections of the form to complete. Survey form navigation can be completely customized, even at runtime, to include or exclude sections, repeat portions, jump directly to different prompts based on entered values, and more. For this example, we will complete the label features, computed assignment of initial values, and custom template sections. However, feel free to enter any combination you like and explore.
Press the Next button in the top right to progress to the next question. Note that we skip the intent launching section and progress directly to label features.
Label Features
This prompt shows that the label and hint fields of the prompt can be customized by editing the HTML and CSS. This allows your organization to modify the look-and-feel of the prompts to suit their needs.
Press Next to see a more complex example:
This prompt shows a label that has been edited to include media files including an image and an audio clip. Press play on the audio clip to hear a bird call. However, media can also be added via spreadsheet columns, which is generally easier.
Press Next to advance to the next section.
Reading Previous Values
This prompt is requesting a value that will be used to render the next question. Enter any name you like and press Next.
This prompt shows that a prompt can use a previously collected value in the rendering of a prompt. For example, a subject's name and gender could be used to properly address them throughout a survey.
Press Next to see another example of data reuse.
This prompt is requesting a value that will be used to render the next question. Enter any value you like and press Next.
This prompt will prepopulate the entered data with the value from the previous prompt. In general, you can prepopulate a prompt with any previously collected value. In another example, you might record a subject's address and then prepopulate that address on their household members address prompts.
Press Next to advance to the next section.
Custom Template
This prompt is requesting data that will be used in the next prompt to render a custom template. We will also use this to demonstrate constraints. Enter an age that is greater than 20 and press Next.
Survey will not allow you to progress until you've entered a valid value. This validation can be done dynamically as well. For example, you could have a running average of crop heights you have measured, and disallow crop heights that differ by more than three standard deviations.
Enter a valid age, weight, and height, and press Next.
This prompt will show the data point you entered in the previous prompt, rendered on a plot of average weights. This is a custom prompt defined in JavaScript for this example, it is not a default display option provided by the ODK-X framework. It demonstrates that Survey can be customized to whatever level your organization requires without the effort of rewriting and recompiling the Android tools.
Press Next to advance to the next section.
Update Value
This prompt is prepopulated from the initial value we entered in the first prompt. Whatever you entered for that field will be filled in here. Updating this field will update the value in the database.
This was the final prompt for this example. Press Next to advance to the final screen of the form.
Complete Form Instance
This screen tells you that you have reached the end of the form. This does not mean that you have entered data for every field. In this example we skipped the majority of the questions. From here you can navigate backwards and update any of your previous answers. You can also use the button in the upper left to navigate to previous questions or leave the form instance.
Warning
Updating answers may cause later prompts to render differently or be invalidated.
To save the form instance, either press Finalize or Incomplete.
Finalize will mark the form as Finalized and indicate that this instance is completed.
Incomplete will mark the form as Incomplete and indicate that this form should be revisited and completed in the future. Use this option to save your progress if you have to pause while filling out a form.
After pressing one of the above options you will be returned to the Survey home-screen. If you select Example Form again you will see this form instance at the top of the list of previously saved instances, with the date you saved it and the state you chose.
Learn More
For more detailed instructions on navigating Survey forms, view the Navigating a Form guide.