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!
Solved! Go to Solution.
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.
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).
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.
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()
Attaching an XLSForm example:
I followed the lead from @JenniferAcunto and created a simple example for you.
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