web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Limiting Data Pulled f...
Power Apps
Answered

Limiting Data Pulled from a SharePoint List

(0) ShareShare
ReportReport
Posted on by 25
Hello Everyone, I'm running into trouble building a quiz generator app. On the home menu I have built dropdowns determining the category, type, and size of the quiz generated. The questions are randomly generated using a flow that pulls from a SharePoint List. I would like to limit the size of quizzes to 10, 20, or 30 questions. How do I do this? This is what I have so far. The first 3 lines do not work however, without them the app functions very well. Not sure what the proper functions would be to filter the amount of quiz questions pulled. If(Dropdown1_4.Selected.Value = "S (10 Questions)", Filter('Quiz Questions',Max(10)); If(Dropdown1_4.Selected.Value = "M (20 Questions)", Filter('Quiz Questions',Max(20)); If(Dropdown1_4.Selected.Value = "L (30 Questions)", Filter('Quiz Questions',Max(30)); If(Dropdown1_3.Selected.Value = "Quiz", Navigate(QuizScreen), If(Dropdown1_3.Selected.Value = "Flashcards", Navigate(FlashcardScreen); UpdateContext({QuestionAnswered:false}); Set(varQuestion,PowerAppTest.Run(CourseDropdown_1.SelectedText.Value,1)); ClearCollect( colAnswers, {Answer: varQuestion.correct_answer, Type: "Correct"}); Collect( colAnswers, {Answer: varQuestion.incorrect1, Type: "Incorrect"}); Collect( colAnswers, {Answer: varQuestion.incorrect2, Type: "Incorrect"}); Collect( colAnswers, {Answer: varQuestion.incorrect3, Type: "Incorrect"}); ClearCollect( colAnswers, Shuffle(colAnswers) ))))))
Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @miguelytulio 

    Yes, your formula is not going to work.  Where is this formula being used?  You are filtering in the formula but the results are going nowhere.

    You're also using a deprecated property (SelectedText) in your formula.  What is the Items property of the CourseDropdown_1 control?

     

  • miguelytulio Profile Picture
    25 on at

    The CourseDropDown_1 control is a Power Automate Flow that pulls from a SharePoint List called "Quiz Questions," and retrieves the items, "Course", "Question," Correct_Answer," "Incorrect_1," "Incorrect_2," "Incorrect_3", "Incorrect_4," "ID," and "Quiz ID."

     

    I am using a button on the home page that utilizes this flow with OnSelect. It generates the quiz questions at random. 

     

    I'm not sure how to build a dropdown that limits the number of questions the flow spits out.

     

    The function worked fine until I added these:

    If(Dropdown1_4.Selected.Value = "S (10 Questions)", Filter('Quiz Questions',Max(10)); If(Dropdown1_4.Selected.Value = "M (20 Questions)", Filter('Quiz Questions',Max(20)); If(Dropdown1_4.Selected.Value = "L (30 Questions)", Filter('Quiz Questions',Max(30)

  • Verified answer
    miguelytulio Profile Picture
    25 on at

    Hi Everyone! I found a way to filter quizzes and flashcard games based on time, size, and category. These are the functions I put in the OnSelect of a "Start" button on the home page. This would then direct the user to the quiz page.

     

     

    //Set Timer Value

    If(

        Dropdown1_3.Selected.Value = "30s.", Set(timerVal,Value(30000)),

        Dropdown1_3.Selected.Value = "60s.", Set(timerVal,Value(60000)),

        Dropdown1_3.Selected.Value = "90s.", Set(timerVal,Value(90000))

               

    );

    //Set Question Limit on Flashcard/Quiz

    If(Dropdown1_1.Selected.Value="S (10 Questions)",Set(varQuestionCount, 10),1);

    If(Dropdown1_1.Selected.Value="M (20 Questions)",Set(varQuestionCount, 20),1);

    If(Dropdown1_1.Selected.Value="L (30 Questions)",Set(varQuestionCount, 30),1);

     

     

    //Select Question/Answers & move to collection, then randomize answer selection

    Set(varQuestion,PowerAppTest.Run(CourseDropdown.SelectedText.Value,1));

        ClearCollect(

            colAnswers,

            {Answer: varQuestion.correct_answer,

            Type: "Correct"});

        Collect(

            colAnswers,

            {Answer: varQuestion.incorrect1,

            Type: "Incorrect"});

        Collect(

            colAnswers,

            {Answer: varQuestion.incorrect2,

            Type: "Incorrect"});

        Collect(

            colAnswers,

            {Answer: varQuestion.incorrect3,

            Type: "Incorrect"});

        ClearCollect(

            colAnswers,

            Shuffle(colAnswers)

    );

    //Reset the count of answered questions & the count of correct questions, clear table of answered questions

    Set(varCount, 1);

    Set(varCounter,0);

    Set(varCorrect,0);

    Clear(colQuestions);

     

    //Navigate to Quiz or Flashcard Screen

    If(Dropdown1_2.Selected.Value = "Quiz", Navigate(QuizScreen), Navigate(FlashcardScreen))

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 190 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard