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 / Export radio control r...
Power Apps
Answered

Export radio control results to excel table

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

I currently have a 5 question quiz that I am using a radio control to allow the user to select a answer. I have then added the below code to give a different score depending on the answer selected.

First question is below:

Switch( Radio3.Selected.Value, "Terrible", Set(Score, 1),
"Bad", Set(Score, 2),
"OK", Set(Score, 3),
"Good", Set(Score, 4),
"Great!", Set(Score, 5) );

 

Then the other questions add to that:

Switch( Radio3_1.Selected.Value, "Exhaused", Set(Score, Score + 1),
"Tired", Set(Score, Score + 2),
"OK", Set(Score, Score + 3),
"Good", Set(Score, Score + 4),
"Strong!", Set(Score, Score + 5) )

 

I would like to export the answer given on each individual question to an excel spreadsheet. 

I have a table in excel with 5 columns, one for each answer, so I would like to add the score from question 1 to column 1, then the score for question 2 to column 2, and so on. Then add the overall score for all 5 questions combined to the final 'total' column. 

 

Any ideas?

Categories:
  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Do you want to save the 5 question answers into your Excel table (Column1~Column5)?

    Do you also want to save overall score for all 5 questions into the "Total" column in your Excel table?

     

    I assume that the data structure of your Excel table looks like below:2.JPG

    Based on the needs that you mentioned, I think the Patch function could achieve your needs. I have made a test on my side, please take a try with the following workaround:

    Within the last question screen of your app, add a "Submit" button, set the OnSelect property to following:

    Patch(
     'YourExcelTable',
     Defaults('YourExcelTable'),
     {
     Column1: Switch(Radio3.Selected.Value, "Terrible", 1, "Bad", 2, "OK", 3, "Good", 4, "Great!", 5),
    Column2: Switch(Radio3_1.Selected.Value, "Exhaused", 1, "Tired", 2, "OK", 3, "Good", 4, "Strong!", 5),
    Column3: Switch(Radio3_2.Selected.Value, "Exhaused", 1, "Tired", 2, "OK", 3, "Good", 4, "Strong!", 5),
    Column4: Switch(Radio3_3.Selected.Value, "Exhaused", 1, "Tired", 2, "OK", 3, "Good", 4, "Strong!", 5),
    Column5: Switch(Radio3_4.Selected.Value, "Exhaused", 1, "Tired", 2, "OK", 3, "Good", 4, "Strong!", 5),
    Total: Score /* <-- Score represents the global variable you set up in your app */ } )

     

    In addition, if you also want to modify previous question answer, I afraid that the global variable Score could not represent the total score you get. Please modify above formula as below:

    Patch(
     'YourExcelTable',
     Defaults('YourExcelTable'),
     {
     Column1: Switch(Radio3.Selected.Value, "Terrible", 1, "Bad", 2, "OK", 3, "Good", 4, "Great!", 5),
    Column2: Switch(Radio3_1.Selected.Value, "Exhaused", 1, "Tired", 2, "OK", 3, "Good", 4, "Strong!", 5),
    Column3: Switch(Radio3_2.Selected.Value, "Exhaused", 1, "Tired", 2, "OK", 3, "Good", 4, "Strong!", 5),
    Column4: Switch(Radio3_3.Selected.Value, "Exhaused", 1, "Tired", 2, "OK", 3, "Good", 4, "Strong!", 5),
    Column5: Switch(Radio3_4.Selected.Value, "Exhaused", 1, "Tired", 2, "OK", 3, "Good", 4, "Strong!", 5),
    Total: Sum(
    Switch(Radio3.Selected.Value, "Terrible", 1, "Bad", 2, "OK", 3, "Good", 4, "Great!", 5),
    Switch(Radio3_1.Selected.Value, "Exhaused", 1, "Tired", 2, "OK", 3, "Good", 4, "Strong!", 5),
    Switch(Radio3_2.Selected.Value, "Exhaused", 1, "Tired", 2, "OK", 3, "Good", 4, "Strong!", 5),

    Switch(Radio3_3.Selected.Value, "Exhaused", 1, "Tired", 2, "OK", 3, "Good", 4, "Strong!", 5),
    Switch(Radio3_4.Selected.Value, "Exhaused", 1, "Tired", 2, "OK", 3, "Good", 4, "Strong!", 5)
    )
    } )

    Please take a try with above solution, then check if the issue is solved.

     

    More details about the Patch function, please check the following article;

    Patch function

     

    Best regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks @v-xida-msft! That worked perfectly!

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
11manish Profile Picture

11manish 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard