ArcGIS Survey123: Math Hacks
Megan Engel, GISP
GIS Manager @ AgriCapture | Certified GIS Professional (GISP) | 14 Years in GIS & Environmental Science | Passionate & Committed to Geospatial Tech & Environmental Resilience
Data collection is tough enough. Add math into the mix, and it gets even harder. As someone who is terrible at mental math (especially when I was in the field), I’m a huge fan of letting Survey123 do the math for me. From auto-filling values and converting units to running calculations, you can make your forms smarter, faster, and less error-prone. This week, I’m diving into how to automate calculations in Survey123, because if we have to do math, we may as well let the software handle it for us.
What Can You Automate with Calculations?
Survey123 is more than just a tool for collecting data; it’s also your personal math assistant. By automating calculations, you can make your forms smarter and save yourself a lot of manual work. Here’s a breakdown of what you can automate:
There’s a ton of flexibility in what you can calculate, and you can apply all kinds of logic to make those calculations as powerful as you need them to be. Just like with relevant fields in Survey123, you can use conditional logic within these calculations too. But remember the tips I shared earlier for debugging; math can get tricky, and adding Survey123 XLS design syntax into the mix can make it more of a challenge to get right.
Check out last week's post to learn more about the logic within the relevant fields that you can also use in calculation fields.
How to Set Up a Simple Calculation
Now that we've covered some of the possibilities, let’s jump into how to set up one of these simple calculations. Calculations will live in the "calculation" column of your XLS design. Below are some simple examples on things you can do.
Auto-sum multiple fields
You can sum values of multiple fields using a simple formula. Just make sure the fields you are summing are numeric.
# Sum fields 1, 2, and 3
${field1} + ${field2} + ${field3}
Date and Time
If using dates and times in surveys, I highly recommend checking out this post about formatting them in a way a human can read: Dates and Time in Survey123
# Today's Date
today()
# Date and Time RIGHT NOW!
now()
领英推荐
Unit Conversions made easy within your survey design
Remember to check the units of your original values before performing conversions to avoid errors
# Convert Acres to Square Meters
${acres} * 4046.86
# Convert feet to meters
${feet} * 0.3048
Concatenate Strings
Use concatenation to generate structured IDs, ensuring consistency across survey data and datasets.
# SiteName - StreamName - Assessment - Date
concat(${Site_Name}, "_", ${Stream_Name}, "_Assessment_", now())
Formulas with Logic
These types of logic in your calculation column can help automatically categorize data based on field observations, reducing manual data entry and errors.
# Stream determination (NCDWR example)
if(${total_points} <= 19, 'Ephemeral', if(${total_points} <= 29, 'Intermittent', 'Perennial'))
Want to learn more? Check out these posts, and I suggest you bookmark them for later: XLS Formulas & Survey123 Tricks of the Trade: Calculation modes. Also, make sure to check out the "Calculations" sample in Survey123 Connect!
Next week we will wrap up our Survey123 journey with some hot tips!
Pro Tip: When setting up calculations in Survey123, the last thing you want is an end user accidentally (or intentionally!) messing with a calculated field --> TRUST NO ONE! The best way to prevent this? Set your calculation fields to "read-only."
Detail-oriented and responsible GIS professional with 10+ years of experience
1 周Great information!
GIS Analyst | Geospatial Data & Mapping | Python & SQL | Remote Sensing | ArcGIS & QGIS | IT Integration
1 周Very informative