Skip To Content

Media

Adding images and audio to your surveys can provide clear instructions and detailed references for your users. You can also capture images and audio in your surveys to provide information that would be difficult to communicate otherwise.

Images

To be included in your survey, all images must be saved in the media subfolder of your survey project.

Images can be added to any question by including the exact file name of the image file (including the file extension) in the media::image column of your survey worksheet. Use a note question to display an image that is not associated with a question.

To include images for multiple choice questions, add the media::image column to your choices worksheet. Add the exact file name of the image file (including the file extension) for each choice in this column. Set the appearance of the multiple choice question to minimal to display the images only.

Note:

Survey123 is case sensitive. Ensure all references to file names and their extensions use the same case as the actual files. For example, Tree.JPG is not the same as tree.jpg, and if referenced like this, the image would not display in your survey.

Selecting an image in a survey presents a full-screen view of the image. Return to the survey using the back button in the upper left corner.

An image can also be submitted in your survey using an image question. This allows you to submit either an image saved on your device or a photo taken with your device's camera.

A photo taken in Survey123 will be saved as a .jpg file, with a quality level dependent on your device's camera. You can set the desired image size on the Settings > Images tab in Survey123 Connect. The following four options are available:

  • Small is 320x240 for a 4:3 photo, 320x69 for a panorama photo, and 320x320 for a square photo.
  • Medium is 640x480 for a 4:3 photo, 640x137 for a panorama photo, and 640x640 for a square photo.
  • Large is 1280x960 for a 4:3 photo, 1280x734 for a panorama photo, and 1280x1280 for a square photo.
  • Unrestricted allows any photo size to be attached to the survey.

By default, image size is set to Medium. Submitted images that were saved on the device keep their original file type, resolution, and quality.

Image questions also have alternate appearance types to annotate photos, draw on a canvas, or pen a signature. For more information on these, see Appearance.

You can also use the pulldata() function to extract standard Exchangeable Image File (EXIF) metadata tags from the response to an image question. Entering the following example into a decimal question will extract the device latitude value from an image:

pulldata("@exif", ${image}, "Gpslatitude")

This pulldata() functionality supports the following locational EXIF tags:

EXIF tagDescription

Gpslatitude

Latitude of the device location as a string.

Gpslongitude

Longitude of the device location as a string.

Gpsaltitude

Altitude of the device location as a string.

GPSLatitudeRef

The latitude reference (i.e., N,E,S,W) of the device location as a string.

GPSLongitudeRef

The longitude reference (i.e., N,E,S,W) of the device location as a string.

gpsdestdistance

The distance between the device and destination locations, in kilometers, as an integer.

GpsImageDirection

The direction to the destination location from the device location as a string.

gpsdestlatitude

The latitude of the destination location as a string.

gpsdestlongitude

The longitude of the destination location as a string.

GPSDestLatitudeRef

The latitude reference (i.e., N,E,S,W) of the destination location as a string.

GPSDestLongitudeRef

The longitude reference (i.e., N,E,S,W) of the destination location as a string.

The following example can be used to display both the latitude and longitude value in a single field, that could then be used to populate a geopoint question.

string(pulldata("@exif", ${image}, "gpslatitude")) + " " + string(pulldata("@exif", ${image}, "gpslongitude"))

Spike integration

Image questions also support integration with the Spike laser measurement solution developed by ikeGPS, which allows you to capture the measurements and location of an object from a photo. For information on how to use Spike with Survey123, see Appearance.

Spike records a number of additional custom tags by writing a JSON object to the ImageDescription EXIF tag containing nonstandard properties relating to the Spike device and the measurements it has taken. The tags are described in the following table:

Spike tagDescription

device_id

The ID of the Spike device as a string.

local_accuracy

The accuracy of the Spike device as a decimal.

destination_altitude

The altitude of the destination location as a rational.

declination

The declination of the Spike device as a rational.

pitch

The pitch of the Spike device as a rational.

rotation

The rotation of the Spike device as a string.

objects

A JSON array of the measured objects (area and lengths) as a string.

To access these Spike properties, first extract the JSON object stored in the EXIF using pulldata on the objects property as follows:

pulldata("@exif", ${image}, "objects")

Once this JSON object is in another field, you can use the spike. property name path to extract a specific value from the JSON array. The following example will extract the pitch of the Spike device from the question with the array inside it:

pulldata("@json", ${spikedata}, "Spike.pitch")

The objects array also contains the areas and lengths captured by the Spike device. This array contains the measured objects in the image, including shapes and lines, as well as an alignment shape used for image transformation. The objects in the array can be extracted by referring to their position in the array, an order that corresponds to the order they were captured. The following example will return the first area or line in the array:

pulldata("@json", ${spikedata}, "Spike.objects[1].type")

Note:

Position 0 in the array will always contain the alignment shape.

To return the amount of objects present in the array, use the length property as follows:

pulldata("@json", ${spikedata}, "Spike.objects.length")

To see examples of these tags in use, see the Spike sample survey in Survey123 Connect. For more information on Spike, see the ikeGPS products page.

Audio

To be included in your survey, all audio files must be saved in the media subfolder of your survey project.

Audio can be added to any question by including the exact file name of the audio file (including the file extension) in the media::audio column of your survey worksheet. Use a note question to play an audio clip that is not associated with a question.

To include audio for multiple choice questions, add the media::audio column to your choices worksheet. Add the exact file name of the audio file (including the file extension) for each choice in this column.

When audio is included in a survey, a speaker button will be active on the form. Select this button to play the audio file. Audio files can be played repeatedly.

An audio clip can also be captured in your survey using an audio question. This captures an audio file using the default audio capture method for your device.

Audio responses are limited to two minutes in length. Survey123 records at a 22010 Hz sample rate in mono, and the audio is stored as a lossless .wav file, which means that a maximum-length audio file is about 5 MB in size. Audio quality will vary depending on your device but will typically be of an acceptable level for speech recordings.


In this topic
  1. Images
  2. Audio