I’m building a multi-step survey system with the following logic:
Each User can have one or more Projects,
The user begins by selecting a Project they’re linked to (or they can create a new one). Once selected, a new Session is created, and the questionnaire starts.
The survey is structured by Themes (which act like “pages” or steps). For example:
Theme 1 Question 1
A.
B.
C.
D.
Question 2
A.
B.
C.
D.
Question 3
A.
B.
C.
D.
Each Theme can have a varying number of Questions, and each Question has between 4 to 6 possible Answers. The user must select only one answer per question.
The Questions are displayed sequentially within each Theme. The user clicks Next to move to the next Theme, and finally Submit to complete the survey.
Each Question has:
A predefined set of Answers shown in a specific order.
A score assigned to each Answer.
A weight (importance) that may vary per question.
A type (for now, only single-choice, but in the future could include Yes/No or free text).
All Questions are linked to a Theme, and all Answers are stored in a Session Responses table.
Each Session stores:
The selected answers in a Results field (as a list or linked entries).
A global Score, calculated at the end using the individual answer scores.
I am having a hard time finding a way to display this correctly without having to hard code / write manually things.
Somehow you can’t retrieve data from multiple table once you’ve created a layout? Or maybe i missed something?
The cleanest way to do it would by to have all the questions in a single screen and use visibility conditions to show or not questions.
Create a table that you would call something like “Form Helper Table”. It would work as a “helper table / facade”
Add a user-specific number column (step). Set it to 1.
Add one user-specific column per question.
Add a single row.
Add query columns to get data from other tables if needed for any purposes. Filtered data ready to use.
In you screen, select the new table as the source of the screen.
For each group of questions, you could have a container with the visibility conditions on the step column.
The submit button would execute a workflow that insert the data in the Session Responses table, but also do a set columns value on the helper table to reset everything.
Hmm I’d would do two tables: Questions + Answers (for choices). Then build the custom collection for Questions with visibility conditions displaying various answer entry fields or choices. All the answers points, weights kept in the Questions table in user-specific column and then easily rolled up.
This should be faster to set-up and maintain/expand, especially on the interface side.
How do you clean the answers up though? This is where the monotonous work comes in because this will have to be done by one big workflow relating to multiple rows from the questions table.
So I guess, choose your poison
By the way, for one app I’m building I couldn’t do any of the above because I expect the answer and questions to grow in number to a terrifying extent over time… So, I just put all the quiz data into one JSON cell and the loaded that into an AI component.
The AI component might’ve taken 8 hours in total to configure but was worth it
With set columns value after the add row in the workflow.
I agree that dynamic questions is better with the JSON+custom collection+ai component method. I made a “kinda” form builder in Glide by using this Yes, took a lot of time, but works!
For simple form that never changes of rarely, doing the first method is pretty much simpler.
Thought you suggested single-row table with multiple columns; I suggested multi-row table with single answer column. If the number of questions grows in time this could cause some headaches For a simple form, definitely easier.
I was referring to the solution I suggested. I we’re picking, say, 10 questions for a particular form, we’d need 10 dynamic relations to call when erasing values from the related Question Table rows.
This is where it would be nice if Glide could allow you to populate a choice component from an array column (something we’ve been asking for since 2019). I guess the AI component might be able to do this perhaps.
Here’s what I would do to give you the most dynamic setup possible while attempting to conserve rows.
Themes/Quizzes Table
GBT Questions and Answers Table
– Theme ID column
– Question column
– Correct answer column + other answers columns
– Make Array column to join these answer columns together
– Include theme column id and either a dynamic or fixed index number
GBT Responses table
– User submits answer, question id, user identifiers, etc.
– lookup to question table to check for correctness
Current Question 1-row query table
– Tracks which Theme and Question you’re on (make relevant relations to tables above)
– Use this table in a custom collection or dedicated screen to display the correct info per question
– Be sure to look up the make array column from #2 above
Answer Choices Helper Table (we want to display the answer choice as a choice component)
– 6 row table.
– Lookup column that points to table 4 and looks up the make array column
– Use an index column and single value column to parse the make array column so that the answers are on their own rows. Use this in a choice component when displaying the question.