Hi,
i'm making a trivia app where users can answers to questions and check their score.
The Questions are stored inside a DB made with a sharepoint list that has the following structure
- QuestionID - an INT number that autoincrements
- QText - a string
- Topic - a string value that store the topic of the question
- and more...
When the user decide to play, the questions are retrieved making a simple lookup with a random value that is generated picking a value from 1 to the count value of the Sharepoint list
//retrieve the total number of questions in the DB
UpdateContext({QuestionsCount: CountRows(QuestionsDB)});
//set the current question ID picking a random number between 1 and QuestionsCount
UpdateContext({CurrentQuestionID: RandBetween(1,QuestionsCount)});
//retriving the question text
LookUp(QuestionsDB,Text(CurrentQuestionID) = QuestionID).QText})
this is working fine but i want to make also a special type of game where the user can pick questions related to a single topic.
What's the best way to filter?
I could store all the filtered questions inside a Temp collection but then i won't be able to pick the random question using a rand between 1 and Collection Count because many ID would be missing.
what do you suggest?
thanks