Canvas App: Adding Radio Buttons in Gallery for related records
I am trying to build a Questionnaire where a user is presented a number of questions, for each question, there are a different possible umber of options from which the user needs to select one. In some cases, the user may be asked to include comments.
I am handling this by having two tables in Dataverse, 'Questions' and 'Options' and these have a 1..n relationship.
In my canvas app I have created a Gallery with all the Questions. within the Gallery I have added Radio control and for items I have added the following: Filter(Options, "Question.QuestionNo = ThisItem.QuestionNo)". This loads the correct options for each question and displays them correctly as options for the questions.
Now I need to link the radio control to the 'Selected' field of the options, currently a Yes/No type field, but can change if needed. What would be the best way to submit the answers and load the previous answers if it had been previously submitted.