Optimizing performance of survey

424
5
12-30-2021 12:41 PM
Katherine_Clark
MVP Regular Contributor

So, after many many hours of work and research, I was so excited to finally get my complex survey built in Survey123 Connect ready to publish. 

The survey is big. The XLS Form has 187 rows, there are five different .js files with multiple functions in each of them. There are external choice lists with thousands of different species names for the region, which use the "pull data" function to autopopulate their indicator status. There are also many other calculations and dependencies built within the form.

I thought I was already doing what was recommend as "best practice" for large surveys (i.e. using the Page style, using external choice lists, etc) but even with doing all of this, the survey crashes on iOS (apparently related to a bug that is supposed to be fixed in the 3.14 version release of the field app). When opening on Android, it doesn't crash but the survey takes 2.5 minutes to open. 

Is there anything else I can be doing to help optimize the performance of my survey that I'm missing? Or was Survey123 just "not built" to handle surveys like this? 

5 Replies
DougBrowning
MVP Notable Contributor

Are you passing whole repeats into the JS functions?  I have a large repeat and it crashes JS every time.  There is a lot to pass in.  Maybe there is a way to do some of what you want without JS?

3.14 did seem to help with memory so I would try it.

Post the form if you can.

Katherine_Clark
MVP Regular Contributor

Hi Doug, thanks for the response! I've attached the XLS form.

Unfortunately, yes as far as I can tell, I need to pass in the entire repeat to do the calculations I need, for multiple repeats. If you have any suggestions for improvements though I'm all ears.

For version 3.14, it is still only available through the EAC, right?

DougBrowning
MVP Notable Contributor

Funny I do a ton of monitoring forms like this.  I think the big issue here is you are doing analysis calculations in the form.  We stay away from that.  Forms are really just to collect data not for analysis.  The big issue you will run into is people fixing species codes and such in the web map after the data is collected.  When they do none of the calcs refire.  Our other issue is we do 3 transects and do 1 form for each to keep the size down.  So we have to look across forms later anyways.  We also took some calcs out because people are using the numbers before QA.  If you fix something in QA then again the calcs do not refire giving bad numbers.

Also we separate the species list out and store.  So we have the species code in the form but the common name and all of that is in a lookup table.  In that table we store things like is it invasive, annual, type, etc.  A plant can vary annual/perennial across states.  So we just log what they saw and then can adjust the analysis based on the species list for that state or when things like invasive change over time.

I cannot see your calcs but these seem like you could do them in Arcade for viewing.  The other option, which we do, is run a python script to generate all the calcs.  We serve this out as a diff feature class so the raw data and calcs are separate.

Prob not what you were hoping for but I do not think this form is going to work very well as is.  I work with the BLM monitoring program doing Wetland, Lotic, and Terrestrial so feel free to contact me if you are interested in our methods.

Sorry I was not more help.

Katherine_Clark
MVP Regular Contributor

That's very interesting to hear your feedback! With this particular form, I actually created a python script first to do the calculations on the feature layer, but that would have to be done in post-processing. The field crew said they either wanted things calculated and displayed "on the fly", or it wouldn't be much use to them and they would proceed with purchasing a software service that does something almost identical. I was hoping to be able to save my company a lot of money by just using Survey123 which we already have. 

I'm just starting to look into the EAC 3.14 version. On Android, the survey opened in only 10 seconds compared to 2.5 minutes, so that's promising!

DougBrowning
MVP Notable Contributor

Mm maybe take out some of the less important things like common name then.  Not sure they need that out there.

Also are the numbers just for display?  Maybe you could have 1 JS function return a string of values vs calling it multiple times.  You could also maybe use substr to pull values back apart.

The new calcs engine in 3.14 does seem a lot better so far.  Good luck.