Select to view content in your preferred language

Search() and pulldata() with feature service

1536
5
Jump to solution
01-13-2023 03:51 AM
RaynerCastro
Emerging Contributor

Hello!

I'm designing a route control to record daily routes.

I have a select one question with search('nametable?url=...') for a list of buses from a feature service.

I would like other fields to auto-populate with the attributes when a bus is selected. It would be with the same bus feature service that I use before. 

How should i use pulldata()?

Thanks!

0 Kudos
1 Solution

Accepted Solutions
JenniferAcunto
Esri Regular Contributor

It sounds to me that you would be using the search appearance to populate a select one question and then based on the user's selection additional follow-on fields will autopopulate from the feature service. If that's the case, you would use pulldata @layer to grab the JSON of the entire record and then use pulldata @json to parse out individual attributes.

I would recommend looking at the Query Feature Layer sample in Connect for examples on how to build out the syntax. 

JenniferAcunto_0-1673616346052.png

 

- Jen

View solution in original post

0 Kudos
5 Replies
DeloresLoe
New Contributor

The query operation is performed on a feature service layer resource. The result of this operation is either a feature set or an array of feature IDs (if returnIdsOnly is true) and/or a result extent (if returnExtentOnly is set to true).

0 Kudos
JenniferAcunto
Esri Regular Contributor

It sounds to me that you would be using the search appearance to populate a select one question and then based on the user's selection additional follow-on fields will autopopulate from the feature service. If that's the case, you would use pulldata @layer to grab the JSON of the entire record and then use pulldata @json to parse out individual attributes.

I would recommend looking at the Query Feature Layer sample in Connect for examples on how to build out the syntax. 

JenniferAcunto_0-1673616346052.png

 

- Jen
0 Kudos
Tim-Woodfield
Regular Contributor

Did you end up having any luck with this?

Tagging @IsmaelChivite for any pointers with using the search() appearance and using that selection for the pulldata()

0 Kudos
IsmaelChivite
Esri Notable Contributor

Attaching an XLSForm example:

  • I use search() to populate a country list using a World Countries layer
  • Then I use pulldata("@layer") to populate other questions in the form (iso code, land rank, etc) for the selected country

Search Pulldata.gif

I followed the lead from @JenniferAcunto and created a simple example for you.

Tim-Woodfield
Regular Contributor

Thank you! I was in the process of editing my post as I just figured that out. I added an extra step to pull the entire JSON first and then parse but will take that out and add the where clause to the @ layer calculations like you did. Keeps it simpler. 

 

Thanks again,

Tim

0 Kudos