ichivite-esristaff

Understanding Notes in Survey123

Blog Post created by ichivite-esristaff Employee on Nov 14, 2017

Surveys are for the most part about questions, but very often you need to provide some context before users can actually give you a good answer. And that is where notes come into play.

 

Notes allow you to insert text and images in between questions in your Survey123 smart form. Here are the main three reasons why you may want to use notes in your form:

 

  1. Information: Notes are useful when you want to provide users with some information that will help them capture data more appropriately. A note for example, could provide a reminder in an invasive species  survey that the inventory of invasive species should be performed in a radius of 100 meters. In a population census enumeration survey, notes can also include certain tips for the enumerator to introduce questions to respondents. 
  2. Warnings: Notes can be used to warn users about inconsistencies in the data captured, before it is  submitted. For example, if we do not want people to capture the location of an observation while on the move, we can make a warning note visible whenever we detect that the geopoint object has a speed larger than 0 meters per second. We could also use a warning note if we detect some  logical inconsistencies in the captured data.  Of course, we could use constraints in Survey123 to prevent all this bad  data to be submitted, but note provide a nice way to bring the user's attention into these  problems.
  3. Look&Feel: Finally, notes are a great way to bring banners and or logos  into your form to make them look exactly as you want.

 

The Basics

 

The use of notes is supported in both Survey123’s Web Designer as well as Survey123 Connect. The easiest way to create a note is to use Web Designer, where you can easily format your text using custom font sizes, colors, bullets for your paragraphs and even embedded images and links. Through Web Designer you can also control the alignment of your text in the notes: centered, right aligned and left aligned.

 

Here is how you can add notes to your survey in Web Designer:

 

 

Notes in XLSForms

 

Do  not set a name for your note  questions!   Notes do not expect user  input so they do not  need it. If you set the name  of your label, then  Survey123 Connect will create a field  in your feature service  that  will always be empty.

 

In XLSForms, notes are modeled as a note type of question.  The most important rule when using notes is that they do not require any value in the name column of your XLSForm. That is right: unlike other types of questions in XLSForms, the name column is not mandatory. In fact, it is typically better that you leave it empty.

 

 

The reason for this is simple: When you publish a survey with Survey123 Connect, the values in the name column of the survey worksheet define the attribute columns in the feature layer where we will persist your data.  Since notes do not expect any user input, there is no need to  give them a name.

 

Other than the above, notes behave like most other XLSform questions:

 

  • HTML formatting is supported in notes. You can use  HTML formatting for way more than cosmetic reasons. You can for  example add links. In the next example, I added a link that will trigger a phone call to the Water Department.

 

TypeNameLabel
note<center><a href="tel:9091234567">Call Water Department</a></center></p>

 

  • Media: You can associate media to a note question. Use the media:audio and media::image columns for this. In the next example, a note is used to allow the user to play an audio file from the survey.  Images and audio files referenced must be stored in the media folder of your survey.

 

typenamelabelmedia::audio
notePlay this audio before counting <i>Gubernatrix cristata</i> callsgcristata.mp3

 

  • Relevant: Relevant expressions can be used to make notes appear and dissapear. In the next example, A warning is shown to the user if the location is fixed while on the move. When adding warnings, I like to

 

typenamelabelrelevant
geopointlocationLocation
noteDo not move while fixing location!0.2 < pulldata("@geopoint", ${location}, "speed")

 

  • Calculations: You can use calculations to display text in the main body of a note. In the following example, a note is used to indicate the number of choices selected in a select multiple question.

 

typenamelabelcalculation
select_multiple violationsviolationsCode Violations
noteViolations observedcount-selected(${violations})

 

When calculating a note, you may want to have  your text all be shown in one single line, rather  than split in two like above. If that is the case, you can do something like the following:

 

typenamelabelcalculation
select_multiple violationsviolationsCode Violations
note</b>concat("Violations: ", count-selected(${violations}))

 

The only reason I use </b> in the label is because the label column is mandatory for a note. <b> will not render any text, so the main body of the note will read a a single  line of text, which is what  I want.

Outcomes