Unstable List Box Control in a Gallery - Selection Issue
I am building a fairly large questionnaire app in Power Apps (around 700 questions). All of my questions are loaded on one screen, except they are filtered based on Areas and SubAreas selected on previous screens. So one "section" consists of around 10-70 different questions that have to be loaded at once (continuously scrollable).
To display the questions I am using a gallery (linked to a Sharepoint list of questions) where I have placed numerous different controls that are visible based on Question Type. The OnChange property for each of the controls saves the answers in a local collection (colAnswersDraft) and upon clicking the submit button, using Patch, the answers are stored in a separate Sharepoint list.
Even after reloading the app, exiting the screen, etc. I wanted the user to easily view their previously submitted answers, which is why I set the OnVisible property for my questionnaire screen to load all the answers from the Sharepoint list into a local collection (colAnswersSaved) and then linked the default properties of each of the controls to this collection. I put a text label in the gallery to check if the answers were loaded back properly, and they are.
The issue is as follows:
For my Yes/No questions (which are the highest in number, around 450) I am using a single select list box for which the default property is set correctly (as I already mentioned, checked with a text label) - if there exists an answer for this question in colAnswersSaved, take that, if not, be blank - works like a charm.
I put another text label, which would let me check what the Selected value of the control is (Text = YesNo.Selected.field_1 (where field_1 is where the items (Yes and No) for the list box come from)) and here is where the problem arises. When I am actively filling out the questionnaire, clicking on Yes or No, the label displays what I clicked, as expected. However, even after saving all my answers, if I completely close the app (reload it) and open it back up, the text label for my selected value suddenly becomes blank (while the default value is still Yes or no - whatever answer I saved in my Sharepoint list of answers), thus making the control "blank" as well (with nothing selected).
If I move to a different screen, navigate between different parts of the app and come back, the selection isn't blank, it only becomes blank after reloading it - but I expect that the users will do so, and I don't want them to come back to the app and suddenly find blank controls, even though saved answers actually exist for those controls and there is no need to fill anything out again.
I learned that controls in a gallery may be unstable, thus limiting their ability to perceive their default value as their selected value - I tried splitting the questions into smaller sections, I tried the radio control, but nothing seems to work.
The odd thing is that every other control (Rating scale, text input, combo box, even other list boxes which are not Yes/No but rather multiple choice questions with different options) works perfectly. Their default value and selected value loads correctly and the previously submitted answers are highlighted/displayed on the controls.
What could be the issue with the Yes/No list box specifically? how can I ensure that it "selects itself" based on its default value?
Another important thing to mention is that upon every reload only one (the first) Yes/No control selects itself properly and then the rest are blank. Also the main distinction between other multiple choice list boxes and the Yes/No one is that for each of the other list boxes the list of items (set in the Items property) are unique (since there is a big range of questions with various different answers), but not for Yes/No.
I hope I explained everything well enough and I would greatly appreciate any help or advice on this matter. Thank you.