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 / Retrieving Multiple Co...
Power Apps
Answered

Retrieving Multiple Columns from Single Record

(0) ShareShare
ReportReport
Posted on by 2

I am new to Power Apps and am trying to create my first application. I am running into a few issues though.

 

I am trying to create an app that identifies the user, grabs a random question from a database, give four possible answers, then records whether or not their answer was correct. I am able to confirm the user by their email and grab a random question, but trying to use the radio buttons for the multiple choice question is not working.

 

My database for the questions and answers is below.

MitchellH_0-1596133933045.png

 

My Formula for the Question Label is...

MitchellH_1-1596134315268.png

 

My Formula I am trying to use for the radio is...

MitchellH_2-1596134386896.png

 

I was wondering if any one could help me understand how to retrieve the four possible answer columns and place them into the radio. If it is possible, I would also like to randomize the order of the answers.

 

Also, if there is a better way to retrieve a question from the database, I am all ears.

 

Any help would be appreciated. Thanks.

 

Categories:
I have the same question (0)
  • eka24 Profile Picture
    20,923 on at

    The most simplest approach is to put the table on the Items property of the Gallery.

    That way each row of a gallery will populate the possible answers

     

    If you want to show one question at a time, filter The Gallery

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • MitchellH Profile Picture
    2 on at

    Is there a way to do this without using the gallery? I would much rather be able to edit the questions from the excel doc and have it retrieve the questions and answers from there.

     

    Thanks,

  • CU24091509-0 Profile Picture
    417 on at

    using gallery is the best way.

  • eka24 Profile Picture
    20,923 on at

    For you to be able to Use the Radio, the answer option should be in a column rather than a row.

     

    The work around is to insert 5 textboxes:

    1. Textbox1: QuestionID

     

    2. Textbox2

    LookUp (Questions,QuestionID=Value(Textbox1.Text), Correct1)

     

    3. Textbox3

    LookUp (Questions,QuestionID=Value(Textbox1.Text), Correct2)

     

    4. Textbox4

    LookUp (Questions,QuestionID=Value(Textbox1.Text), Correct3)

     

    To move to the next question, you can Use the random formula to change the question numbers

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

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

    Hi @MitchellH ,

    Do you want to retrieve possible answers into a Radio control based on the chosen question?

     

    Based on the needs that you mentioned, I think the Concat function and Split function could achieve your needs. Please try the following workaround:

    Set the Items property of the Radio control to following:

    Split(
     Concat(
     Filter(
     ShowColumns(Questions, "Correct", "Incorrect1", "Incorrect2", "Incorrect3", "QuestionText"),
     QuestionText = Label5.Text
     ),
     Correct & ";" & Incorrect1 & ";" & Incorrect2 & ";" & Incorrect3
     ),
     ";"
    )
     

    Note: I assume that the Label5 represents your Question Label.

     

    If you also want to randomize the order of the answers, please modify above formula as below:

    Shuffle(
     Split(
     Concat(
     Filter(
     ShowColumns(Questions, "Correct", "Incorrect1", "Incorrect2", "Incorrect3", "QuestionText"),
     QuestionText = Label5.Text
     ),
     Correct & ";" & Incorrect1 & ";" & Incorrect2 & ";" & Incorrect3
     ),
     ";"
     )
    )

    Shuffle function

     

    Please try above solution, hope it could solve your problem.

     

    Regards,

  • pawanjajoo Profile Picture
    191 on at

    Hi @MitchellH ,

     

    I agree with @v-xida-msft . I have also written an article on a requirement similar to yours. I am using a SharePoint List instead of Excel. You should be able to do something similar.

    Ref: https://www.c-sharpcorner.com/article/connecting-datasource-dynamically-in-power-apps-using-power-automate-part-2/

     

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 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard