Survey123: Tips and Tricks for Enhancing Your Survey

Survey123 for ArcGIS℠ an Esri® application

Survey123 for ArcGIS℠ an Esri® application

Any organization looking to convert paper based field data collection workflows to a digital solution must consider using Survey123 for ArcGIS℠. Survey123 for ArcGIS℠ (Survey123) is a mobile app from Esri that supports form-centric data collection. This is useful for a wide range of workflows, from asset inspections to logging time on-site, and everything in between!

Survey123 is more than just an app; it is an entire solution for creating, sharing and analyzing field collected data. The survey forms can be created using a simple web interface by an ArcGIS℠ Online user, or using the more advanced Survey123 Connect desktop software. The wide range of applications for the Survey123 software is a great asset to any organization using GIS and can open the door for robust field data collection and subsequent analysis.

While surveys can be completed by end users using a simple web interface or a mobile app, the Survey123 Connect software allows analysts and developers to utilize Excel forms to create “smart” forms with advanced calculations, default values, conditional question filtering, and much more.

In this post, we will focus on some tips and tricks for enhancing your survey using the Survey123 Connect software including:

  1. How to use ‘Secret’ fields in your survey, and why

  2. How to maintain rolling totals from numeric form entries

  3. How to capture before and after pictures at a location

Note – It is assumed the reader has some level of familiarity with Survey123 Connect and related terminology used in this blog post.

Tip 1: How to use ‘Secret’ fields in your survey, and why

When using Survey123 Connect to author and publish surveys, the software will create and maintain a feature service that is needed to support the questions in the survey. Basically, each question in the survey equates to a field within the feature service that is created. However, sometimes you might have information in the survey that you don’t necessarily want to store as fields in the survey feature service. Examples of this can be temporary notes during survey creation or an intermediate calculation variable that does not need to be stored in a field upon submittal. To control this, Survey123 Connect users can use the bind::esriFieldType column in the survey’s XLS form.

The bind::esri:fieldType column allows you to control the type of field added to the survey’s feature service more precisely. For example, if you had a question that accepts an integer value but you want to store this as a text value in the feature service, you could set the bind::type value in the XLS form to int and bind::esri:fieldType to esriFieldTypeString. Other accepted values include:

  • esriFieldTypeString

  • esriFieldTypeDate

  • esriFieldTypeInteger

  • esriFieldTypeSingle

  • esriFieldTypeDouble

  • esriFieldTypeSmallInteger

  • esriFieldTypePointZ

  • esriFieldTypeGUID

  • null

null.png

Note the last value in the list above is null. This will cause the question to be omitted from the feature service associated with your survey! This works for all types of questions except Geopoints.

https://doc.arcgis.com/en/survey123/desktop/create-surveys/esricustomcolumns.htm

 

Tip 2: How to maintain rolling totals from numeric form entries

When using repeats within the survey form, it has traditionally been difficult to access data from different repeated instances from within your XLS form. However, starting at version 2.1 of Survey123, Esri has introduced aggregate functions that can be used to return values referencing the data across repeats! The aggregate functions that can be utilized are: count, sum, min, and max.

As an example, say you wanted to calculate the total number of hours worked in a day. To accomplish this, you could create a question in your survey XLS form inside a repeat called HoursSpent, which would allow users to input the number of hours spent on a particular task, and would allow them to create multiple entries. Additionally, you would create a field outside of your repeat called TotalHoursSpent, with the calculation set to sum(${HoursSpent}).

Calculation Table.png
HoursSpent_SingleEntry.png

The result would appear as shown on the right.

This image shows a single time entry.

 
HoursSpent_AdditionalEntry.png

This image shows an additional entry with the total hours calculated on the fly!

 
Mobile Image_Adding Photos to Survey.png

Tip 3: How to capture before and after pictures at a location

One of the great features of Survey123 is that it allows field workers to easily take photos and upload them with their survey response. This could be useful for maintenance workers to relay information on work completed, for crowd sourcing community information with images, or as in this case, attaching before/after photos for work completed for fire hazard mitigation.

This can be achieved by adding an image question, which allows the user to upload a photo from their device or upload one saved on their device. Multiple images can be added by using Repeats. However, this issue can get more complex if the survey item needs to be revisited in the future to add additional photos, as in the case with before/after photos.

However, this too is achievable through use of the Inbox. The Inbox is a feature that allows users to edit data that has already been submitted. This can be enabled in the Settings pane of your survey in Survey123 Connect. Additionally, SQL Where clauses can be enabled to restrict the number of values returned.

 
Adding Photos.png

For the example of adding before/after photos, a repeat (related table) was created to house photos and some attributes, which allows users to add multiple photos to a single survey. After adding the before photo, the survey is submitted.

At a later date, the user can return to this item through the Inbox, and add an after photo, then resubmit. In this example, some expression logic was used to tell the Inbox which records to make available to modify; this takes the form of a simple SQL expression such as: NeedsAfterPhoto = “yes”.


 
Uploaded Item.png

Upon navigating to the Inbox, the newly uploaded item with a before photo only appears and can be modified.

Note that there is a known limitation that previously added media cannot be modified once in the Inbox since the Inbox does not fetch/download attachments. This means that after photo(s) can be added, but you will not have access to your before picture.