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 / Random question based ...
Power Apps
Answered

Random question based on column count

(0) ShareShare
ReportReport
Posted on by 3

Hi all!

I am attempting to create a questionnaire for an audit process.

 

My vision is for a user to open this PowerApp, have 5 questions generated from the list at random (Im thinking of using shuffle for this aspect). The end goal is to have a column that notates the max amount of times the questions are asked. For instance, Question 1 may be asked 3 times while question 2 may only be asked once, based on the severity of the question. So out of the 30 questions, there may be 50 questions actually being asked over time, After all 50 questions have been answered it will reset and start from the beginning again.

 

Does this sound plausible? I'm not quite sure how I would filter the shuffle to only show the top 5 questions if the column for the max amount of times asked has been met.

 

Any information or existing articles on a similar topic would be helpful.

 

Categories:
I have the same question (0)
  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @DeanRichter22 ,

     

    I assume there is a SharePoint Online list:

    vbofengmsft_0-1650524232572.png

    You could use this formula to get the 5 questions randomly.

    ClearCollect(TheTable,QuestionList);
    If(CountRows(Filter(TheTable,TheMaxCount >TheCount))<5,UpdateIf(QuestionList,true,{TheCount:0});ClearCollect(TheTable,QuestionList));
    ClearCollect(FiveRandQuestions,FirstN(Sort(AddColumns(Filter(TheTable,TheMaxCount >TheCount),"Rank",Rand()),Rank),5));
    ForAll(FiveRandQuestions,Patch(QuestionList,LookUp(QuestionList,ID=FiveRandQuestions[@ID]),{TheCount:TheCount+1}))

    Add a data table and set it's Items property to 

    FiveRandQuestions

    vbofengmsft_1-1650524376654.png

     

    Best Regards,

    Bof

     

  • DeanRichter22 Profile Picture
    3 on at

    Thanks for the information! I'm still fairly new to developing PowerApps, in python I think I could figure it out with just some time while coding, but for this I was not quite sure where to begin..

     

    I will attempt this and see if it works for my use case and update the thread. Thanks Bof!

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#2
11manish Profile Picture

11manish 205 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard