I am attempting to create a select one question based on the x,y location of the geopoint. Preferably I wanted to have all assets within a 50m radius of the surveyor's location appear in the drop down. It does not appear that you can use greater than or less than within the choice filter. So, I have modified the process to use x and y locations rounded to the nearest 100. This is working as expected on a subset of data in the choices tab. However, it is not working at all with the external_choices tab. I have tried forcing the attributes to integers int() which did not help. I've attached an example for reference.
Hi Ingrid,
Yes, you can use multiple fields in the choice filter with external selects (such as x and y). I had a look at your survey and have been able to get it working with just a few minor changes. Note that as you have 50,000+ choices in your external choice list, the survey is very slow to load and respond. Unfortunately this is because you are pushing the limits of the application using such a large choice list which must be searched/filtered with every focus change.
Firstly, the pulldata() function is a string function and causes the field type in the app schema to be created as a string and any further calculations to be processed as a string, this can cause issues with field type mismatches when doing numeric calculations. The calculate questions you used were created as field type string in the app, check the schema preview. Even though you set the esri field type to double, this only applies to the feature service, and not the field being used in the app. Therefore we must manually set these calculations fields to decimal. You can do this in two ways, change the question type to decimal (not calculation), however then these fields are no longer hidden from the user, but you could make them read only.
The other option is to use the bind::type column to set the two final calculations fields to be of type decimal, which will keep them hidden, and your calculations and choice filters will work as expected.
I also cleaned up the xlsx file by removing the un-needed select one and associated choice list and columns in the choices sheet, only leaving the fields and options needed to get this to work correctly using the external select. Also note I added a test record to your external choice list so that it would work based on my location, don't forget to remove it. Updated xlsx file is attached.
Hope that helps.
Regards, Phil.
Are you sure you can use two different columns in the lookup? I was testing this all day yesterday and for sure mine will only use one column. In fact the column must be one set name.
My detailed post is here
Thanks
This turned out to be commas and other special chars in the list! Thanks to Esri for finding.
It seems like you cannot use != in a choice filter. If I do layer != ${nonplant} I get nothing.
Thanks
Can you use an If statement in the choice filter? I cannot get it to go. external choices are used here.
LRR_NAME=${LRR_Choice} and if(${MajorSoilType}="HistosolOrHistic", HistosolOrHistic=${ForLookups}, if(${MajorSoilType}="ClayeyOrLoamy", ClayeyOrLoamy=${ForLookups},Sandy =${ForLookups}))
I want to change which column I do the lookup based on another question.
I also tried to use the field name to create the lookup column name and that did not work either. Would be slick though.
${MajorSoilType}=${ForLookups}
thanks
LRR_label | name | label | HistosolOrHistic | ClayeyOrLoamy | Sandy |
A- Northwestern Forest | None | None | |||
A- Northwestern Forest | A1_Histosol | A1-Histosol | Y | ||
A- Northwestern Forest | A2_Histic Epipedon | A2-Histic Epipedon | Y | ||
A- Northwestern Forest | A3_Black Histic | A3-Black Histic | Y | ||
A- Northwestern Forest | A4_Hydrogen Sulfide | A4-Hydrogen Sulfide | Y | Y | Y |
A- Northwestern Forest | A11_Depleted Below Dark Surface | A11-Depleted Below Dark Surface | Y | Y | |
A- Northwestern Forest | A12_Thick Dark Surface | A12-Thick Dark Surface | Y | Y | |
A- Northwestern Forest | F1_Loamy Mucky Mineral | F1-Loamy Mucky Mineral | Y | ||
A- Northwestern Forest | F2_Loamy Gleyed Matrix | F2-Loamy Gleyed Matrix | Y | ||
A- Northwestern Forest | F3_Depleted Matrix | F3-Depleted Matrix | Y | ||
A- Northwestern Forest | F6_Redox Dark Surface | F6-Redox Dark Surface | Y |
For now I created Dups in the list and put the column name in as the lookup value.
Like this
LRR_NAME | LRR_label | name | label | SoilType |
A | A- Northwestern Forest | None | None | |
A | A- Northwestern Forest | A1_Histosol | A1-Histosol | HistosolOrHistic |
A | A- Northwestern Forest | A2_Histic Epipedon | A2-Histic Epipedon | HistosolOrHistic |
A | A- Northwestern Forest | A3_Black Histic | A3-Black Histic | HistosolOrHistic |
A | A- Northwestern Forest | A4_Hydrogen Sulfide | A4-Hydrogen Sulfide | HistosolOrHistic |
A | A- Northwestern Forest | A4_Hydrogen Sulfide | A4-Hydrogen Sulfide | ClayeyOrLoamy |
A | A- Northwestern Forest | A4_Hydrogen Sulfide | A4-Hydrogen Sulfide | Sandy |
A | A- Northwestern Forest | A11_Depleted Below Dark Surface | A11-Depleted Below Dark Surface | ClayeyOrLoamy |
A | A- Northwestern Forest | A11_Depleted Below Dark Surface | A11-Depleted Below Dark Surface | Sandy |
A | A- Northwestern Forest | A12_Thick Dark Surface | A12-Thick Dark Surface | ClayeyOrLoamy |
A | A- Northwestern Forest | A12_Thick Dark Surface | A12-Thick Dark Surface | Sandy |
A | A- Northwestern Forest | F1_Loamy Mucky Mineral | F1-Loamy Mucky Mineral | ClayeyOrLoamy |
Hope it helps someone.
Hello Philip Wilson is there a list of functions which will work with the Choice_filter? As Doug Browning mentioned I am unable to get != to work in the choice filter. Any suggestions? My goal , to get a list of other people in a household.
Workflow:
select_one person to survey >calculate Person type and Household ID.
select_one list of other members in household (choice_filter- HouseholdID=${HouseholdID) and PersonType!=${PersonType}. It does not work with != in the formula, but will if it is =. Thank you for your time.
Hi Andrew,
Currently with the 3.10 release (or earlier) the choice_filter column does not support functions (expressions). The good new is we are working on this for the 3.11 release, allowing you to have more complex expression in the choice_filter column, thus allowing cascading selects and choice filters on select_multiple questions.
This is currently in beta and you can test it out with the 3.11 beta builds available on the Early Adopter Community.
Regards,
Phil.