Is it possible to create a list filter in order to populate a single field in a survey?

1165
7
02-26-2018 09:27 AM
ZachLindfors1
New Contributor II

I need to filter a large list into two sub-lists. One of the two smaller lists will be active depending on the answer to a previous question but have to populate the same field in a database table. Is this possible?

0 Kudos
7 Replies
by Anonymous User
Not applicable

Hi Zach,

I believe you are referring to using cascading and external selects and the choice filter option? Using these options you can configure a choice list to be filtered based on the answer to a previous question and only show a subset of the entire choice list.

More info can be found here: Cascading and external selects—Survey123 for ArcGIS | ArcGIS 

Regards,

Phil.

0 Kudos
ZachLindfors1
New Contributor II

Thanks Philip. I've tried the cascading and a choice filter but I'm struggling with the concept because the filter has to be a many to many relationship. Basically what I have is a question that has 9 choices. If the response is one answer, the next question should have 3 choice options. If the first answer is any of the other 8 choices, the next question has about 15 different choice options. Does that make sense? 

0 Kudos
by Anonymous User
Not applicable

Hi Zach,

What you are describing sounds exactly what cascading selects and choice filters are designed for. Can you share a copy of your survey xlsx form, that way I can take a look as to why it is not working.

Phil.

0 Kudos
by Anonymous User
Not applicable

Hi Zach,

Thanks for your survey, I have taken a look and now understand your problem further. You are correct in that a select one and cascading select works with a one to many relationship, not a many to many relationship. Therefore simply using the choice filter as I suggested and a cascading select will not work.

Also note that you are using square brackets [...] around your choice list names, this is not supported and will cause undesired effects in your survey. For instance, some calculations, external choice lists with choice filters etc will not work with the extra set of square brackets around choice name. Please remove them from everywhere in your survey.

Good news is there are two ways you can get your select ones to work and filter choices, so depending on your preference you can do it either way:

Option 1: Using the cascading select and choice filter you need to duplicate the choice list values for F1 to F10 (expect F9). This will create an entry in the choice list that has an associated value in the parent choice list. The upside of this option is that in the survey questions you do not require any modification (no extra questions or settings) besides adding choice filter. The downside of this option is the duplication of values in the choice list, the more values you add the more you have to duplicate, and in future if you want to update the labels, it requires more work. See attached example.

Option 2: Use two extra fields (questions) in your survey with two different choice lists (one of F1 to F10  and one for F9) and set them as relevant based on parent choice. No need for choice filters. Set these two fileds as null esri field type and have the final answer calculated based on these two fields and saved into a hidden field. Only the first and last question will be written to feature service (same as your original survey), the other two select one questions are only visible and used in the app for the user to select the correct answer. See attached example.

Personally I would use option 2 as it is easier to manage moving forward.

Hope this help.

Phil.

0 Kudos
ZachLindfors1
New Contributor II

Thanks for the help Philip. I'll probably have to use the first option because the location options need to populate a single field in our table. The other option I have is to add a note to the three location options so that the user knows that those are only used if F9 is selected. However, this introduces the potential for entry errors which is what we're trying to avoid.

Zach

Get Outlook for Android<https://aka.ms/ghei36>

by Anonymous User
Not applicable

Hi Zach,

Actually Option 2 is also writing the location options into one single field in the table, the other two extra fields are not stored, they are just used in calculation in final field to combine the choices from the previous two question. We achieve this using the esriFieldType of null.

Anyway, hope either of these two suggestions helps.

Phil.

0 Kudos
ZachLindfors1
New Contributor II

Thanks for the help Philip. I have a better grasp on the second option now and yes that probably is the better choice. I’m not sure I totally understand what the null field type does though. Does using the null esriFieldType mean that the field does not appear in the feature service or does it mean the records default to null? I just want to make sure I am not adding any fields if they are not necessary even if they are null.

Zach Lindfors

GIS Analyst

Power System Engineering, Inc.

Direct: 608-268-3517

Mobile: 920-723-8406

lindforsz@powersystem.org<mailto:lindforsz@powersystem.org>

<http://www.powersystem.org/>

CONFIDENTIALITY NOTICE: This message contains information that may be confidential and privileged. Unless you are the intended recipient, you may not use, copy or disclose to anyone the message or information contained in this message. If you received this message in error, please advise the sender by reply e-mail and delete the message.

0 Kudos