What's the best way to set up a dynamic survey?

2898
14
03-18-2019 12:18 PM
AlexDamiao
Occasional Contributor

I have a survey with about 250 distinct questions which are all of the yes/no type. The idea of the survey is that a subset of these 250 questions will only appear if they are applicable (depending on a "condition" chosen by the person filling out the survey. Let's call these conditions 'condition_1', 'condition_2',...,'condition_150').

For example, if a person starts the survey and selects 'condition_22', then the survey will only show yes/no questions for what makes sense under that condition (could be questions 3, 67, 98, 99, 143).

So, my approach was to use the relevant column and insert the conditions there. I insert all 250 questions in the "survey" tab of the xlsform and fill out the "relevant" column accordingly. So for example, if question 30 is applicable only under conditions 23, 57, 129, my relevant column would look like:

${variable}='condition_23' or ${variable}='condition_57' or ${variable}='condition_129'

For the dataset that I have, some questions appear for all 150 conditions, so you would have ${variable}='condition_1' or .... or ${variable}='condition_150'.

I implemented this survey and what I've been finding out so far is that the phone app and the Survey123 Connect for ArcGIS are both having trouble loading it up (it crashes 9 out of 10 times, making it unreliable for this task). The browser version doesn't crash, but it doesn't work properly. There is a noticeable performance drop (it takes about 20 seconds just to load the conditions you choose from) which I currently cannot get around.

Am going about this wrong? Is there something simpler that I didn't realize I could've done instead?

Thank you in advance!

0 Kudos
14 Replies
Jim-Moore
Esri Regular Contributor

Hi Alex

If possible, could you please share your XLSForm so I can investigate?

Thanks,

Jim

AlexDamiao
Occasional Contributor

This is what the survey would look like for a user just starting to fill it out.

How the survey looks like in the beginning

If I choose a certain condition it may trigger the survey to only show some of the questions.

Choosing a condition as an example

If I choose another condition (condition 23) the questions may or may not change.

Choosing another condition as example

The problem is that a good amount of questions would appear for almost all conditions chosen. This is probably breaking the survey (my guess of what's happening) given the amount of "or" conditions in the XLSForm.

0 Kudos
Jim-Moore
Esri Regular Contributor

Hi Alex

Thanks for the XLSForm. The very large external choice list in your survey (50,000+ rows) is likely the main thing affecting performance. One option is to try the 64-bit Beta versions of the field app and Connect. These are available for download on our EAC:

https://earlyadopter.esri.com/project/article/item.html?cap=e69ef91f45744b98882c651f7b518eb7&arttype...

I did not encounter any issues in the web form. What specific issues are you seeing? Which browser are you using?

A couple of other things to try regarding performance:

  • Remove extraneous fields from the external choices tab (i.e. image and language columns).
  • A choice list can be used by more than one question, so you could have one yes/no list on the choices sheet to use with all select_one questions (see attached example).

Please note 'condition' is a reserved keyword (see types tab for a full list). These keywords should be avoided for question names.

A couple of ideas where question relevance is concerned:

The or statements you've used in your XLSForm are logical; however in the relevant column there are four unique scenarios (categories?). So one approach would be to determine which category the selected condition is in, and then set the relevance of each question based on that category. One benefit of this approach is that if you need to modify a category, it only needs to be changed in one place. Please see attached example (you might choose to make these category questions hidden). Another option would be to put the category into the name of the condition, for example you could prefix each condition with c1, c2, etc. and then in the relevant column use something like contains(${condition},'c1') etc.


Best regards,
Jim

AlexDamiao
Occasional Contributor

Hi Jim,

First of all thank you very much for helping me out on this matter! Much appreciated!

What I observed when trying to deal with the XLSForm I attached here (with the multiple "or" conditions in the relevant column for most of the questions) is that both the Survey123 Connect for ArcGIS (version 3.2.196) and the phone app (version 3.3.26) would not open/load the survey. It kept automatically closing whenever I tried to edit or fill out the survey.

On a browser (Google Chrome) it did work considerably better. The performance drop I noticed was on getting a first response from the first page of the survey: it was taking about 15/20 seconds for the survey to respond once you clicked a drop down. It felt as if the survey wasn't fully loaded even though you could see the drop downs in the screen. Once it responded then the rest of the survey went smoothly.

I'll implement the suggested changes from your attached survey and see what happens. I won't be able to get rid of the 50k rows in the external_choices sheet but the idea of using the categories will hopefully do the trick. Ideally I want to use the phone app as the method for filling out this survey.

Best regards,

Alex

0 Kudos
Jim-Moore
Esri Regular Contributor

Hi Alex

Glad to be of assistance! Thanks for the additional info. Could you please confirm your field app version number? The latest release build is 3.3.64. Also which device(s) are you using?

Best regards,
Jim

0 Kudos
AlexDamiao
Occasional Contributor

Hi Jim,

My mistake, indeed the field app version is 3.3.64.

I ran the XLSForm you attached and I think there is some issue with the survey when it comes to the required column. Even though "yes" is specified for all questions, I'm still able to send the survey out without answering them (I get a positive validation when validating input):

Do you think that's because of the fact that we're using the relevant column simultaneously? How do I ensure the answers are mandatory? I believe this is not expected behavior.

Thanks again,

Alex

0 Kudos
Jim-Moore
Esri Regular Contributor

Hi Alex

Thanks for the catch; unfortunately it appears this is being caused by a previously reported bug affecting 3.3 with required questions that are relevant. I have updated our internal notes with your survey and comments and we will be aiming to address this in the 3.4 release. Please see more discussion on this here: https://community.esri.com/thread/229359-required-message-not-working-in-all-repeats#comment-834155

I'll endeavour to update this thread with any new info.

Best regards,
Jim

AlexDamiao
Occasional Contributor

Hi Jim,

Thank you for the information. Any idea when this release will happen?

Alex

0 Kudos
Jim-Moore
Esri Regular Contributor

Hi Alex, the next release should be out in mid-May, hopefully including a fix for this issue. Once this issue is addressed the fix will likely be made available for testing in a beta build on our EAC, so you could keep an eye out there as well for announcements. Kind regards, Jim