Hi all,
I’m working on a Survey123 form using the search() appearance with an autocomplete question. The goal is to filter results by beach code, survey year (2025), and nest final status ('TBD'). The solution needs to work in the Survey123 web app.
Here’s the current expression I’m using, which works for filtering by beach code and year:
autocomplete search("nest_ID_List?url=https://services.arcgis.com/Qv.../arcgis/rest/services/survey123_123...._results/FeatureServer/0",'matches','beach_Code',${beach_Code},'survey_Year','2025')
However, I'm struggling to add a condition that filters for nestFinalStatus = 'TBD'. When I try to include this in the where clause or as an additional match parameter, the autocomplete stops returning results or ignore the TBD filter parameter.
This code work but it ignore the TBD filter parameter.
autocomplete search("nest_ID_List?url=https://services.arcgis.com/QV.../arcgis/rest/services/survey123_1a8...1_results/FeatureServer/0",'matches','beach_Code',${beach_Code},'survey_Year','2025','nestFinalStatus','TBD')
Any suggestions on how to structure the expression correctly?
Thanks in advance for your help!
Note: The codes below does work in connect and mobile app but not in web-app:
1) autocomplete search("nest_ID_List?url=https://services.arcgis.com/QVE.../arcgis/rest/services/survey1....d1_results/FeatureServer/0&where=...'" + ${beach_Code} + "' AND survey_Year=2025 AND nestFinalStatus='TBD'")
JB
Here's the parameter layout for the search() function.
search(tableName, searchType, searchColumn, searchText, filterColumn, filterText)
The reason your example, where the TBD doesn't work, is because there are 6 parameters for the search() function and 'nestFinalStatus' and 'TBD' are parameters 7 and 8. It doesn't know what to do with those.
The search() function does allow a WHERE expression and I think you're close with your last example. What I would try for the where query is just the nestFinalStatus = 'TBD' and then use the beach code and survey years as the search and filter parts of the function. So something like this:
autocomplete search("nest_ID_List?url=https://services.arcgis.com/QVE.../arcgis/rest/services/survey1....d1_results/FeatureServer/0&where=...", "matches", "beach_Code", ${beach_Code}, "survey_Year", "2025")