Search Appearance inside Repeat does not save selection

691
4
12-03-2021 10:58 AM
KristinThorpe1
Occasional Contributor

I am creating a survey with Survey123 Connect (Version 3.12.232) for field inspections at construction sites. My construction (point) feature layer is related to an inspection table. I am using a series of select_one questions with search() appearance to populate several dynamic lists from the construction layer. I use these selections to filter down the project name, construction type, and location to identify the actual construction site that is being inspected. I have two select_one search appearance questions inside a repeat (ideally they will stay within the repeat). I use these selections as variables in a pulldata() function that queries my feature layer and returns attributes for the selected construction site.

This workflow works great for only the first repeated record. When I add a new repeat, the selections in the previous repeat become unselected and I lose the pulldata() values. I think this error is because I am using the search appearance; it looks like the select_one is not maintaining the dynamic list when a new repeat is added. Any thoughts as to why this might be happening?

4 Replies
KristinThorpe1
Occasional Contributor

@KimberlyMcCallum Hi Kimberly! This was my original post to my "Dynamic Choice Lists using Search Appearance" dilemma. Unfortunately, I have not found a solution. I'm thinking the problem lies within the fact each time a repeat record is added, the search() is run and it pulls fields from the feature service all over again, consequently clearing selection of the previous repeat. 

As a workaround, I moved the select-one search() questions outside my repeat and added text fields inside the repeat with the calculation set to the select-one questions. If the text field is set to read only it will not recalculate when a new repeat is added and the value within the repeat will reflect what was selected. At least in may case, the functionality of the repeat is now how I want it. But, the select-one question is still selected and there is nothing prompting the user to select a new choice from the list, so it's a little clumsier and not ideal for someone who's not familiar with how Survey works.

AllardTerence
New Contributor II

I'm experiencing the same issue, are you aware if a solution to this issue been identified?

0 Kudos
AllardTerence
New Contributor II

I identified a solution to this problem. I made a copy of the value on which I wanted to base the filter as a hidden calculated field inside of the repeat and set "calculationMode=always" in the bind:esri:paramaters.

0 Kudos
DustyJordan
Occasional Contributor

Hi Allard, 

Did this fix end up working out for you long-term? 

I've been pulling my hair out over the past week trying to solve this issue of fields within my repeat getting deleted when users scroll backwards through repeats. I found your post here and thought I'd finally found the fix! I did extensive testing of it last night and everything seemed good, but when I went to use our field devices today I'm finding out the issue persists. 

It's been this way the entire time I've tried figuring this issue out. I think I have a solution, works in testing, but then the next day the issue persists like nothing changed. 

0 Kudos