Skip navigation
All Places > Survey123 for ArcGIS > Blog > 2016 > May
2016
ichivite-esristaff

The art of hiding

Posted by ichivite-esristaff Employee May 28, 2016

This blog post is all about using the relevant column in your XLS file to hide orSmaller.gif show questions in your survey. The relevant column is present in the survey worksheet and can optionally hold an expression, which will make the corresponding question be hidden if it evaluates to false, or show the question if it evaluates to true.

 

Hiding and showing questions can help you simplify your survey. Relevant expressions will also let you show notes when appropriate to facilitate data entry.

 

Lets go first through some examples:

 

Say you only want to ask a question if the response to a previous question is 'yes':

 

 

 

typenamelabelrelevant
select_one yes_noowner_presentIs the house owner present?
textowner_nameName:selected(${owner_name},'yes')

 

 

Other relevant expressions may include:

  • ${PreviousQuestion} < 18
  • int(${QuestionA})+ int(${QuestionB}) > 100
  • today() - ${LastInspectionDate} > 1000*60*60*24*15 (the last inspection happened more than 15 days ago)

 

When using mathematical operators, one needs to be careful with empty responses. If a question has not been answered, it evaluates to 0. This would make for example ${PreviousQuestion} < 18 always return true, if ${PreviousQuestion} has not been answered.  To resolve this issue, you can add your expression to an if block as follows:

 

  • if (condition, a, b)  If the condition is met, returns a, otherwise returns b.
  • if(string-length(${PreviousQuestion}) = 0, false, ${PreviousQuestion} < 18)
  • if(string-length(${LastInspectionDate})=0, false, today() - ${LastInspectionDate} > 1000*60*60*24*15)

 

The safest way to check if a question has  been answered is using string-length(${QuestionName}).  If string-length returns 0, then you known the answer is empty. This function works well with question types of all sorts: with numbers, text, images, dates etc

 

In some cases, you may want to use regular expressions (regex) For example, the following expression can be used with a note type of question. If the expression evaluates to  true, the note is shown, otherwise it is hidden.

 

  • regex(${Q2}, '[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}') (user typed a valid e-mail address in Q2)

 

A special case when using relevant statements are select_multiple questions. For them, the count-selected and selected statements are very handy.

 

Capture.PNG

 

To learn more about select_multiple questions, have a look Understanding Multiple-Choice Questions in Survey123 for ArcGIS 

 

Relevant expressions can be applied to many different types of questions: select_one, integer, text, image, barcode, repeat etc. You can also apply them to notes as well as to Groups and RepeatsGroups are of particular importance because a relevant statement applied to a Group will have effect over all questions within that Group.  If you have three or four questions to which you want to apply exactly the same relevant expression, you may want to consider creating a Group and apply the expression only to the Group. This will make your Survey load faster because you will be reducing the number of times the expression needs to be evaluated.

 

Another aspect to keep in mind is the effect relevant statements have on submit. If a question is not relevant (it is hidden), then data in that question will not be submitted to ArcGIS.

 


The International Esri User Conference is approaching fast. Here is a list of all Technical Workshops and Demo Theaters where you will be able to learn more about Survey123 for ArcGIS and meet other Survey123 users.

 

 

Technical Workshops

 

Survey123 for ArcGIS: Collect Field Data with Smart Forms

Tuesday, June 28 10:15 AM – 11:30AM Room 07 A/B

Wednesday, June 29 1:30PM – 2:45PM Room 08

Friday, July 1 9:00 AM – 10:15 AM Room 04

 

 

Survey123 for ArcGIS: Advanced

Wednesday, June 29 3:15PM – 4:30 PM Ballroom 06D

Thursday, June 30 1:30 PM – 2:45 PM Ballroom 06 B

 

Extending Survey123 for ArcGIS

Thursday, June 30 3:15 PM – 4:30 PM Room 33 A

 

ArcGIS Apps for Field Data Collection

Tuesday, June 28 1:30 PM – 2:45 PM Room 04

Thursday, June 30 8:30-9:45 Room 03

 

Demo Theaters

 

Survey123 for ArcGIS: Tips and Tricks

Wednesday, June 29 10:30 AM – 11:15 AM Demo Theater 8 - Apps

 

Survey123 for ArcGIS: Take Your Maps Offline

Wednesday, June 29 11:30 AM – 12:15 PM Demo Theater 8 - Apps

 

Extending Survey123 for ArcGIS

Thursday, June 30 10:30 AM – 11:15 AM Demo Theater 8 - Apps

 

Mobile SIG Meeting   

Wednesday , June 29 12:00PM - 1:00PM Room 03

 

 

Just in case we have last minute changes to the agenda, it is strongly recommended that you bookmark the sessions of your interest in the Esri UC Online Agenda.

A barcode is an optical machine-readable representation of data. A lot of things around us have barcodes. You will find them in virtually any packaged item you buy, in the back cover of books and most likely somewhere in the laptop, its power adapter, or the PC you may be using right now.

 

Typically, barcodes are attached to things using a sticker, or simply printed on them. You can put any data you may want in a barcode, but generally they are used to unequivocally identify the item.  Barcodes are designed to encode data in a way that can quickly be scanned using either a barcode scanner, or through the camera of your smartphone.

 

The canonical use of barcodes with Survey123 for ArcGIS is that IMG_0015 (002)b.jpgwhere an asset, like a pole, meter, pipe etc has a barcode in it; Field users with Survey123 would scan this barcode to quickly bring the unique identifier and other asset information into the Survey. In this way, room for error when capturing the unique identifier of the asset is removed, not to mention that capturing the data is very quick.

In this photo, you can see a field user leveraging Survey123 barcode scanning capabilities to support sign inspections. If you look close enough, you will be able to see that the pole and the sign have both a sticker with a barcode. The barcodes include information about the unique ID of the asset, ensuring data integrity and simplifying the completion of the Survey.  Many thanks to Gary Bowles, GIS Database Administrator at Seneca Resources Corporation for the photo and his continuous feedback on Survey123 for ArcGIS.

 

Types of barcodes


There are multiple flavors of barcodes, which we can organize into two categories: linear and 2D (matrix) barcodes.

 

The original barcodes where all linear. They were invented in the 1960's, UPC.pngpopularized in the 1970's and still the most commonly used today. Here is a linear barcode representing the value 036000291452.


Two-dimensional barcodes can encode more information. A popular one these days is the QR code, which you may have already used from your smartphone, may be to quickly access a web site, or to download a mobile app.

QR.png


There are actually lots of different types of barcodes, even for each of these two categories. Choosing one type or the other will depend on what type of data you want to encode (not all types support international characters for example), the size of the data, the amount of space you have for the sticker, etc

 

Another important aspect before choosing the barcode type to use is licensing. Many barcode styles are patented and you could not use them to print your own data.  You can learn more about the different types of barcodes in Wikipedia.  From a practical perspective, if you would like to create your own barcodes, a safe bet is to go with a 2D style, as it will give you good flexibility to store data of different sorts. And one that is in the public domain, such as Aztec or QR Code.

 

There are different ways to create barcodes. To start playing around a bit, I personally liked qr-code-generator.com and also barcode-generator.org. You will also find API's, to create these barcodes programmatically, as well as solutions of all sorts to print stickers: in bulk, from a pocket printer, to print waterproof barcodes etc  There is really a world around barcodes. If you are hardcore enough you will even find people who will tattoo them on you.

 

Barcodes in Survey123 (The Basics)

Smaller.gif
If you would like field users to be able to scan a barcode and get the data added to your Survey, you need to add a barcode type of question. Barcode questions, by default, are shown in your form as an input box -where the user can manually enter data- plus a barcode scanner button, which will trigger the device camera.  By simply focusing on the barcode, and tapping on the camera, the barcode will be scanned and the data from it added to the input box of the question.

 

By now, you know that there are many types of barcodes. Survey123 for ArcGIS supports a very specific subset of them: QR Code, Code 39, Code 93, Code 128, EAN 8, EAN 13, UPC A, UPC E, UPC EAN Extension, Aztec, Codabar, Data Matrix, ITF, MaxiCode, PDF 417, RSS14 and RSS Expanded.  If scanning fails, the first thing to check is if Survey123 is configured to scan the type of barcode you are targeting.  Use the menu button in the top-right corner to configure the scanner.   You can configure the barcode scanner to scan any of the supported types if you like.

 

A Barcode Scanning Survey Sample has been added to Survey123 Connect for ArcGIS, so you can get started. Open Survey123 Connect, click on New Survey, and then look in the Samples category. Publish the Barcode Scanning sample survey and download it into your own phone or tablet. You can exercise scanning with some of the barcodes added in this blog post.  You can alternatively download the sample barcode XLS file from here.

 

Minimal Appearance in Barcodes and Calculations

 

Barcode questions in Survey123 for ArcGIS support the minimal appearance. When used, the question will not show any type of input text box. Instead, all the user will see will be the name of the question, as well as the button to start the scanner.   The minimal appearance in a barcode question is typically used in combination with calculations in other questions: the barcode question is used to fetch data, and the calculations extract that data and display it to the user.


Say for example you want to use a barcode to store the Unique Identifier of an asset and the company that produced it. We would not want to show all that information in a single field, because it would be confusing to the field user, and somewhat useless stored that way. So we hide the raw data obtained from the barcode (minimal appearance), and then we use calculations to split that content into two separate questions... like in the following example:

barcode11.png611FFA1 Stark Industries .jpg

For your convenience, here is a QR Code that you can use with the example above. This idea of using barcodes to persist an array of values at fixed lengths is very common. Using the substr function in calculations makes it relatively easy to auto-complete one or many questions in your Survey.

 

Enough talking! It is time now for you to try!

Star Wars Day Update (May)

“May the Fourth be with you” is a pun first used by Margaret Thatcher’s administration in an advertisement celebrating her election victory. While nothing Star Wars has ever actually been released on the fourth, almost every single Star Wars movie was first released in May; The Force Awakens is the only one so far that wasn’t.

This update contains a lot of behind the scenes work to make the entire Survey123 process run better, as well as a few new features to help in gathering data.

 

Survey123.arcgis.com

Log into http://survey123.arcgis.com to discover an improved look and feel of the Survey123 management console. The survey gallery now shows the number of features submitted to each of your surveys, and the live reporting capabilities have been very much improved with better charts and mapping capabilities. You will also notice that the performance of the web site is significantly better when working with very large surveys (surveys have been tested with over half a million points!).

 

Important Note: Clear your browser cache before you try the new web site.

 

Publishing improvements

Coming up with a good survey is often achieved after some trial and error. Up until this release, the feature service associated with your survey had to be re-created every time you made a change in your survey. We did this to ensure your feature service and its survey were all in sync, but the price you had to pay is that any data captured already in that feature service would be lost.

Starting with this release, Survey123 Connect for ArcGIS will be much more forgiving: At publishing time, Connect will only recreate your feature service when absolutely needed. Here are changes in your survey that you will be able to push without having to re-create your feature service:

  • Changing any of the Settings of your survey including: its thumbnail, title, summary, description, style, map properties or the image size setting
  • Changing values in any of the following columns in your XLS file: Label, Constraint, Calculation, Default, Relevant, Language, Image, Audio, Appearance or Required
  • Deleting questions or choices in lists

The following changes will force Connect to recreate your feature service:

  • Adding new questions or repeats
  • Changing values in the Name, Type, EsriFieldLength or EsriFieldType columns in your XLS file

If you want to learn more details about this, check out this help topic.

 

You will also notice that in the field app, you no longer need to delete old versions of your surveys before you download a new one: simply go into the survey download page and refresh your survey!

 

Working with existing feature services

Survey123 now supports submission_urls, allowing you to link to a valid, preexisting feature service. This field can be defined in the Settings tab of your XLS file and it is pretty handy when you want to collect surveys for an existing ArcGIS for Server feature service. This is a pretty advanced feature, requiring you to fully understand how to build surveys that are compatible with your existing feature services. When a submission_url is used, Survey123 Connect will never validate if your survey questions have corresponding columns in the feature service.

 

Averaging enabled on geopoint questions

Capturing a location with a single position is all well and good, but we wanted to do better. Geopoint questions now have support for averaging a series of positions into one single location.

 

To capture your current location, tap the location button in top right hand corner of the location panel.

 

To start capturing a location built from an average of positions, tap and hold the location button in top right hand corner of location panel. You will see the message appear ‘Averaged 1 of 1 positions (1 second)’.

To stop averaging, tap the location button again. To delete this location and start capturing a new one, tap the location button a third time.

 

If you press the form completion button whilst averaging is happening, you will cancel the current location calculation and the previous location collected will be used.

 

Positional accuracy threshold

Using the new body::accuracyThreshold column title in your XLS file, you can help field users capture more accurate data. The value in this column is expressed in meters. If the device used to capture a position is reporting a positional accuracy that is less than the threshold, then the user will see the geopoint panel be shown in red and include a warning message. Once the positional accuracy is better than the threshold, the title area will go back to normal. Note that the warning does not prohibit you from capturing a location.

 

If averaging positions as described above, any position beyond the threshold will not be used in the location calculation.

 

Better Repeats

Questions inside a repeat can now contain constraints, calculations and required fields.

In the following form, multiple values and connections on a pipeline can be surveyed. The ID of each fitting is calculated to incorporate the pipe ID, and many fields are required.

 

This should not be news to you, but using multiple repeats within a survey is supported as long as you do not nest them. That is, as long as you do not include a repeat, within another repeat.

 

Default values are not yet supported within repeats, but will come in a future release.

 

Other enhancements

Barcode questions now have a minimal appearance option. We will shortly publish a new blog post with more details about this.

 

Bugs have been fixed in the implementation of several questions. Integers will no longer overflow, while decimal fields will no longer take invalid characters. Display bugs have been fixed with time fields with single-digit minute readings, and select one questions now play nice with text scaling.

 

Sign-in and authentication has been improved, with Okta now supported.

 

The user can now rename, rotate and delete photos from the Survey123 field app.

 

Improvements have been made to photo browsing and selection. (iOS and Android)

 

Online help

Our documentation has been constantly improving, and now has a quick reference guide for the Survey123 app and website. The tutorials have also been expanded to provide more step by step details to follow, with a number of other pages also being updated with new information.

 

Download Survey123 Connect (1.4.30) and the field app (1.4.28) now from

http://doc.arcgis.com/en/survey123/download/

Enjoy!