# How do I randomly select a cell to show in my custom quiz?

**URL:** <https://community.glideapps.com/t/how-do-i-randomly-select-a-cell-to-show-in-my-custom-quiz/83194>\
**Category:** Ask for Help\
**Tags:** actions, custom-code\
**Created:** [July 15, 2025, 7:03pm UTC](https://community.glideapps.com/t/how-do-i-randomly-select-a-cell-to-show-in-my-custom-quiz/83194 "2025-07-15T19:03:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JimmyLipper](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jimmylipper/32/82964_2.png) [@JimmyLipper](https://community.glideapps.com/u/JimmyLipper)\
**Post date:** [July 15, 2025, 7:03pm UTC](https://community.glideapps.com/t/how-do-i-randomly-select-a-cell-to-show-in-my-custom-quiz/83194/1 "2025-07-15T19:03:41Z")

</div>

I have a quiz set up: **Quiz of People**.

- It is tied to a google sheet " **Q w Adjusted Cells"** , which has a random number column.
- I have a custom page set up “ **Quiz w Adjusted Cells** ”.
- On this page, there are 3 Components: **Text: Q1** ; **Check: Button** ; **Next: Button**.
- Q1: Pulls from the sheet Q1.
- **Check** : Shows the answer A1.
- I want **Next** to go to Q2 and then **Check** to go to A2… but randomized.
- I have set up the google sheet to have the questions as I want them in Q1, Q2, Q3, etc. and the answers the way I want them in A1, A2, A3.

**All I want the Next button to do is to randomly select a Q# cell and then have the Check button show the corresponding A#.**

I’ve included the random column to help do this; we can also do it another way.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [July 15, 2025, 11:26pm UTC](https://community.glideapps.com/t/how-do-i-randomly-select-a-cell-to-show-in-my-custom-quiz/83194/2 "2025-07-15T23:26:19Z")

</div>

I would structure the data like this.

**Questions Table**

| QID | Question | Answer |
| --- | --- | --- |
| Q001 | Who painted the Mona Lisa? | Leonardo da Vinci |
| Q002 | What is the capital of France? | Paris |
| Q003 | What is 2 + 2? | 4 |

**Users Table**

| UID | Name | CurrentQID |
| --- | --- | --- |
| U001 | Alice | Q002 |
| U002 | Bob | Q001 |

Then:

- Add a Query column to the Users table, Query the Questions table where QID **is not** current row’s CurrentQID.
- Add a Single Value column, set it to return a random QID from the Query. I’ll call this “Random QID” from now on.

On the front end:

- Add a screen built on top of the Users table, filter to UID is signed-in user’s UID.
- Add a “Start Quiz” button and show it when Current QID is empty.
- The “Start Quiz” button would set “Random QID” to “Current QID”.
- Add a custom collection pointing to the Questions table, filter by “QID” is “Signed-in user \> Current QID”. Make sure there’s no action on the collection level (it defaults to show details screen).
- Add this to the custom collection: Question text, a field pointing to a user-specific column for the user to write/choose the answer, and a button to show if the answer is correct (please do your own validation here, and visibility conditions accordingly before/after the user clicks the Check button).
- Outside of the custom collection, add a “Next” button, which would do the same thing as the “Start Quiz” button, but only visible when “Current QID” is not empty.
- You might also want to log a list of questions the user has answered and build it into the Query so that the user won’t be shown duplicated questions.
