Select to view content in your preferred language

Search() or pulldata() from a feature table

175
3
07-25-2024 03:00 PM
cabrae7
New Contributor

I am trying to populate a list using data from a table (person_info). This table (person_info) is auto-populated/updated from an outside source. In a perfect world, my survey would go as follows:

  1. The user enters their name in the first field, autocomplete-ed from person_info that is already stored in 
    ArcGIS REST Services.
  2. The next field is auto-populated by a calculation made on the first field, this second field selects their supervisor.

I've spent a lot of time searching and trying new ways and cannot get it to work. I even tried to convert the feature table (person_info) into a feature layer to utilize the search() appearance function as it is exactly what I needed. I read that using search() over pulldata("@layer") in this case, was preferred. (There are no 'geotags' in person_info so I understood I had to do some joins before creating it into a feature layer)

Maybe I am not getting the syntax correctly or my data is set up improperly? Will I have to create a whole script using pulldata("@javascript") that does everything at once... searches the user's name and their supervisors'? I know that some people taking the survey may not have an ArcGIS account. Would some sort of authorization be needed like a token or an API key?

Is there a way to pull straight from a feature table? 

Below is what my general idea is using pulldata() and search():

Pulldata()
pulldata("@layer", "getValue", "attributes.fname", "https://root.com/arcgis/rest/services/database/person_info/FeatureServer/0", arg)

Search()
autocomplete search('subname?url=https://root.com/arcgis/rest/services/database/person_info/FeatureServer/0')

 

0 Kudos
3 Replies
ToddW_stl
Esri Contributor

@cabrae7 - yes, you should be able to accomplish this; see the example here

0 Kudos
cabrae7
New Contributor

I've spent a lot of time on that thread. I've tried to copy every little detail but I would still get "No Matches" when I try to type in the search dropdown. Does making the object I am trying to access through the API services a 'Table' make a difference? There have only been talks about accessing a CSV or Feature Layers.

Any help is appreciated.

0 Kudos
ToddW_stl
Esri Contributor

You can query a table - is this in an enterprise geodatabase?  Can you share your xlsx form?  Are you using a select_one question for users entering their name?  You shouldn't need an API token, but I'd make sure the service is shared correctly.  I'd recommend reviewing these extra tips.  I'd also recommend looking at the "Query a Feature Layer" sample within the New Survey dialog in Survey123 Connect.

0 Kudos