Dynamic Choice Lists Using Search Appearance Issue

2001
2
Jump to solution
01-21-2023 04:46 PM
EthanLambert
New Contributor II

I am trying to populate the choices for two fields in my survey based on a public feature layer in AGOL. I am using the 'autocomplete search()' function in the appearance column. The function returns a blank list instead of the expected values.

The public layer is a table of employee data. (SalaryList) I want to use SalaryList first to fill the options for a couple of name fields on a project tracking form. I read this community post  that described the method. I downloaded the referenced sample survey in the Connect app. The sample works as described. However, the function fails when I use SalaryList information.

I tried just copying the sample query (see picture 1 below)

Picture 1Picture 1

into my form to see if the search function worked generally. I was able to populate my name field with the sample data. When I replaced the sample function parameters--the list became blank again. 

I checked which version of Connect I was running, I have 3.16.111. I copied the field names and values directly from SalaryList to rule out typos, still blank.  I tried replacing different pieces of the function by creating variables instead. For instance, making a new line in the XLSForm to save the layer address as a note & then referencing that note in the search function. None of the variable replacements worked, I thought that my query exceeded the max record count allowed, so I added a filter column/text for the calendar year. Still nothing. I tried the year filter with and without a 'matches' function in front of it. I also tried another layer to see if SalaryList was the issue, the other layer did not work either. Additionally, I was able to use the other layer in a pulldata "@layer" function successfully, so my issue appears to be with the search function specifically.

See picture 2 below for the full text of the search function I am trying to figure out. I would appreciate any advice.

Picture 2Picture 2

For further reference, I attached the full XLSForm as well.

1 Solution

Accepted Solutions
ZacharySutherby
Esri Regular Contributor

Hello @EthanLambert

On the choices worksheet is looks like you may be using an incorrect field, the field NAME doesn't exist in the feature service schema. I had switched it to Employee_Name since that was in the schema. 

For the search() appearance syntax there are more arguments given then what the syntax supports. Here is the full syntax for the search() appearance: search(‘tableName’, ‘searchType’, ‘searchColumn’, ‘searchText’, ‘filterColumn’, ‘filterText’)

Based on what was in cell F6 I had switched it to autocomplete search('employee?url=https://services1.arcgis.com/79kfd2K6fskCAkyg/arcgis/rest/services/Louisville_Metro_KY_Employee_Sala... & Recreation', 'CalYear','2022')

That updated syntax had worked on my end, here is a copy of the same XLSForm with the changes. 

Thank you,
Zach

View solution in original post

2 Replies
ZacharySutherby
Esri Regular Contributor

Hello @EthanLambert

On the choices worksheet is looks like you may be using an incorrect field, the field NAME doesn't exist in the feature service schema. I had switched it to Employee_Name since that was in the schema. 

For the search() appearance syntax there are more arguments given then what the syntax supports. Here is the full syntax for the search() appearance: search(‘tableName’, ‘searchType’, ‘searchColumn’, ‘searchText’, ‘filterColumn’, ‘filterText’)

Based on what was in cell F6 I had switched it to autocomplete search('employee?url=https://services1.arcgis.com/79kfd2K6fskCAkyg/arcgis/rest/services/Louisville_Metro_KY_Employee_Sala... & Recreation', 'CalYear','2022')

That updated syntax had worked on my end, here is a copy of the same XLSForm with the changes. 

Thank you,
Zach
EthanLambert
New Contributor II

That did it, thanks!

0 Kudos