I am building a Questionnaire app.
I need some advice on how to build the questions.
What I have done so far is build a gallery and have a database with a list of questions.
The issue I am facing is not every question requires the same type of response, for example, not all questions are a text box or a drop down etc, they are a mix.
So in my gallery I have all the different types of answers, Drop Box, text, Multi Choice List, Single Choice List.
In my database I have the question and the type next to it.
I am then hiding the form element in the gallery if the type in the data base doesn't equal the form element.
My issue is when i want to submit the answers to the form into a collection then into SQL I cannot define what form elements are active and what isn't.
Example of my Database:
| ID | Question | question_type | What will show on the gallery |
| 1 | Question 1 | 1 | Drop Down |
| 2 | Question 2 | 2 | Text Box |
| 3 | Question 3 | 3 | List Box Single Choice |
| 4 | Question 4 | 4 | List Box Multiple Choice |
Here is a screen shot of my screen you can see in the black square the different form elements, but on the right it only shows the one element.
On each of those form elements visible attribute I have something like this:
If(
ThisItem.q_type = Text("4"),
true,
false
)
Changing the, ThisItem.q_type = Text("4"), bit depending o the type in the database.
I know this is probably hard to understand as I am terrible at explaining but I can answer any questions needed.

Report
All responses (
Answers (