Select to view content in your preferred language

Webmap layer filter by "contains"

5065
21
Jump to solution
11-21-2018 08:01 PM
NaomiBegg2
Occasional Contributor III

I have a layer which is created in Survey123.  One of the questions is a select multiple type. On this question I want to create layer filters so that if it contains a certain text then it will appear in the layer.  The only options I can see is for it to be exactly one thing (or not or blank).

I have 6 different options within the multi type question.  That leads to 61 different selection combinations.  I was hoping that this tool would save me from having to create 61 different test surveys so that I can group them all which would look like (issues is a AND issues is b AND issues is c AND ...)

Is there any other way I can do this? Am I missing something obvious?

1 Solution

Accepted Solutions
JamesTedrick
Esri Esteemed Contributor

Hi Naomi,

A select_multiple field is stored as a string (text) field and should have the option for contains in the filter, as in this example:

There should not be a domain (choice list) associated with a select_multiple, as that prevents the multiple values from being displayed (multiple values are stored as a comma-separated list, so the combinations rapidly become more than we want to store in a domain)

A select_one question (which is discussed in the comments) is stored as a string field with a domain (the choice list) which restricts the value to only a predefined set.

Did you originally create the question as a select_one and then change it to a select_multiple later?  If so, you will need to remove the choice list.

View solution in original post

0 Kudos
21 Replies
EdApalinski
Occasional Contributor

Hi,

The layer filter in the webmap should give you an option to use contains and add multiple expressions as an Or statement as in the example in the attached image.  You can also set up a filter widget in a Web App builder application to accomplish this.

Cheers!

NaomiBegg2
Occasional Contributor III

That's exactly what I'm after but for some reason I only have four options within the filter for my layer.

EdApalinski
Occasional Contributor

I believe the reason you only see is, is not, etc.. is because the field is a number data type.  While the label is text the data element which is written to the feature service is a number type, probably 1,2,3, etc..  Odd that the filter does not use the actual database value instead of the label.  I have a feature service with a domain used in collecotr which shows the 1,2,3 instead of the label.  If you built the survey in the Survey123 Connect app you could use the labels as the database values however spaces are not valid so you will need to use underscores.  If you used the web version perhaps you can change the domain values to be text instead of number based.

Hope this helps,

Ed

0 Kudos
NaomiBegg2
Occasional Contributor III

I'm hoping that it hasn't given itself a second lot of code to confuse things!

Yes I created it using connect and this is what it shows within AGOL.

EdApalinski
Occasional Contributor

I looked at a feature service published using Connect and sure enough the select_one fields do not have the option for 'contains'.  Free text fields do.  You might want to ask this question in the Survey 123 Community since it looks like the select_one and possibly the select_many field types are having the issue.

Cheers

0 Kudos
EdApalinski
Occasional Contributor

just had a thought, you could try to set the bind::esri:fieldType column to esriFieldTypeString in the xls form.  

0 Kudos
NaomiBegg2
Occasional Contributor III

How do I do this?

0 Kudos
NaomiBegg2
Occasional Contributor III

Figured it, just testing now.

It doesn't appear to have been successful 😕

0 Kudos
by Anonymous User
Not applicable
0 Kudos