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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Is it possible to crea...
Power Apps
Unanswered

Is it possible to create a quiz with PowerApp with randomly chosen questions from a SharePoint list?

(0) ShareShare
ReportReport
Posted on by 42

I want to create a quiz with 5 questions. My problem is that I can't create a question pool for Microsoft Forms, so i would try with PowerApp. I want to create a SharePoint list with 20-30 questions and answers as a question pool. The goal would be an app which displays 5 randomly choosen questions with answer options from the sharepoint list.

Categories:
I have the same question (0)
  • timl Profile Picture
    36,383 Super User 2025 Season 2 on at

    Hi @Purman 

    Yes, it's possible to do this with PowerApps.

    Here's a link that shows how retrieve a set of random records.

    https://powerusers.microsoft.com/t5/General-Discussion/getting-a-random-item-set-from-a-collection/td-p/120048

    I would also recommend that you look at @Mr-Dang-MSFT Formativ app here....

    https://powerusers.microsoft.com/t5/Community-Apps-Gallery/Design-Patterns-from-Mr-Dang-Part-2/m-p/198929

    Mr Dang has done some excellent work on this, and I think it contains a lot functionality that you can reuse.

     

  • v-xida-msft Profile Picture
    on at

    Hi @Purman ,

    Do you want to retrieve 5 questions from your SP list randomly, and display them within an app?

     

    If you want to retrieve 5 questions from your SP list randomly, I think the combination of Shuffle() function and FirstN() function could achieve your needs.

    Within your app, please take a try with the following formula:

    FirstN( /* <-- Retrieve first 5 records randomly from your SP list */
    Shuffle('YourSPList'),
    5
    )

    More details about Shuffle() function in PowerApps, please check the following article:

    Shuffle function

     

    If you want to create a quiz question app using PowerApps, and want to save the answers and corresponding questions into your data source, please check and see if the following thread would help in your scenario:

    https://powerusers.microsoft.com/t5/General-Discussion/Converting-the-tutorial-style-slides-into-questions-that-submit/m-p/253996

     

    Best regards,

  • Purman Profile Picture
    42 on at

    Thanks for the answers!

     

    Now I want to display the first question, and the 4 answers from the collection.

     

    Collection name is "QuestionCollection", question column is "Title", answer columns are Answer1...4.

     

     

    How can I display those with FirstN function in a label?

     

    Thank you!

  • v-xida-msft Profile Picture
    on at

    Hi @Purman ,

    Do you want to display the first question and forth answers from your Collection using FirstN function?

     

    I have made a test on my side, please take a try with the following workround:

    Set the Text property of the Question Label to following:

    FirstN(QuestionCollection, 1).Title

    Or

    First(QuestionCollection).Title

    Set the Text property of the Answer1 Label to following:

    FirstN(QuestionCollection, 1).Answer1

    Set the Text property of the Answer2 Label to following:

    FirstN(QuestionCollection, 1).Answer2

    Set the Text property of the Answer3 Label to following:

    FirstN(QuestionCollection, 1).Answer3

    Set the Text property of the Answer4 Label to following:

    FirstN(QuestionCollection, 1).Answer4

     

    Best regards,

  • Purman Profile Picture
    42 on at

    Hi,

     

    i tried preveusly with these lines, but no success.

     

    These are my screens (in the collection the first column is "Answer1"):

    Screenshot (4).pngScreenshot (6).png

    What should i correct? 

     

    Thank you,

    Tamas

  • Verified answer
    v-xida-msft Profile Picture
    on at

    Hi @Purman ,

    The result the FIrstN() function returns is a Table value rather than a Record, please modify your formula as below:

    First(FirstN(QuestionCollection, 1)).Answer1

    Or

    First(QuestionCollection).Answer1

    More details about FirstN function, please check the following article:

    FirstN function

     

    Best regards,

  • Purman Profile Picture
    42 on at

    Wonderful, it's working, thank you!

     

    How can I create If function correctly for checking the selected answer radio button? (I have problem with the right side of the logical test)

     

    If(Radio1.Selected.Value = First(FirstN(QuestionCollection, 1)).CorrectAns, Set(Score,1), Set(Score, 0))

    Thank you!

  • Englishweb Profile Picture
    371 on at

    Hello @v-xida-msft 

    Is there a way to hide the questions and answers from the users of the quiz?

    Thanks!

  • Prometheus365 Profile Picture
    6 on at

    Hi @Purman ,

     

    Really late to the party here but I've a video series on a quiz app that I created.  I'm sure you've finished your app long ago but just in case you find any of it useful.

     

    https://www.youtube.com/watch?v=qEFEZz-kk8I&list=PL_5RWrZIgHKHV12XPhoAH3C9Su33VbZaG

     

    Good luck,

    John

  • Englishweb Profile Picture
    371 on at

    Hello John

    Thanks very much for taking the time to reply. I will certainly watch your videos.

    My question now is: how to hide the quiz answers from the users (students). So if you have any ideas I would be very interested!

    Thanks

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard