Help

Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here

Selecting a random row/record in a table and displaying results

2922 2
cancel
Showing results for 
Search instead for 
Did you mean: 

I’ve seen this question asked a few times but still no solution. I would like to use airtable as the database for my trivia app. I need a way to randomly select row/record which will have the question, and then display the contents. The part I havent seen a solution to yet is how to select a random row/record from only the populated rows. Any ideas?

2 Replies 2

Here is one possible method:

  1. Create a new field for a random value.
  2. Set the random value either using the Batch update block or Scripting block.
  3. Sort according to the random value field and take the first record in the view.

You might love using Airtable’s Flashcard Block. It randomly goes through your records and does exactly what you have requested — it randomly pulls the questions & answers from your base.