I am creating forms for a forestry study. We collect the diameters of trees in a plot, among other information. I use the repeat feature for collecting tree data. We sort the trees from largest to smallest to calculate the quadratic mean diameter of the 8 biggest trees.
I am wondering if it's possible to view/sort the tree entries by largest-smallest diameter, in some sort of table, list, other form, etc besides navigating back to the form submission. Interns may see over 100 trees in a given plot, so navigating the entries by hand to figure out which are largest could be inefficient and tedious in a field setting.
I'm pretty new to Survey123 so I would appreciate any recommendations. Thanks!
Solved! Go to Solution.
To my knowledge, that would be beyond the current ability of Survey123. Survey123 can perform basic functions such as Max, Min, Average, Sum on the all values in a repeat but currently does not have the ability to select or filter prior to performing these functions. That being said, do you need to perform this in the field?
This could be very easily be post-processed on the collected data once submitted. Not knowing your current workflow, I cannot offer a specific example but would typically use a custom script running in ArcGIS Desktop or Pro. You could even have a place holder in your survey that a script running on the back end could calculate and update the quadratic mean for the eight largest trees for each survey on a nightly basis.
Thank you so much!
Unfortunately I also lack JS proficiency, and I have not been able to get this to work in the form.
It reads the message:
Error: Qt.createQmlObject(): failed to create object:
c:/Users/jessikamcfarland/ArcGIS/My Survey Designs/QMD test RMS/extensions:2:1: Script file:///C:/Users/jessikamcfarland/ArcGIS/My Survey Designs/QMD test RMS/extensions/JSFunctions.js unavailable
Thanks a ton - the JS function will be incredibly helpful, just trying to navigate how to implement it now.
I basically copied the extensions folder with the JS function into my folder for the survey. I was able to edit the function in Notepad to make slight changes, save as a .JS, and it worked pretty well!
The big thing I noticed is that despite the error message in Survey123 Connect, the form works once its downloaded onto your device. If you are receiving similar error messages, you should try downloading the form to assess its functionality.
Does that answer your question?
Thanks for posting this Jessika, my problem is very similar and I was hoping I could get Ismael to chime in on this. I want to have a list of components (~30) sorted alphabetically in a repeat when I open a survey. The work flow is that components are constantly replaced, so "batteries" end up at the end of the list, making it hard for technicians to locate the component they want to update. By your example above I could use:
//Sort the array in alphabetic order
var arysorted = ary.sort();
In doing this, I would have to create a new element like "component2" to put this pulldata function in the calculation field. Is there anything forthcoming that would allow an alphabetical sort without having to create a new field? This would save me a lot of work! Thanks for your time.