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 / Quiz adding up scores ...
Power Apps
Answered

Quiz adding up scores to display

(0) ShareShare
ReportReport
Posted on by 43

Hello, I am trying to build my first app at work for a simple app.  I am trying to add up scores (Scrollable quiz).  I have the following on the "view Score button", but I'm not sure how to:

1. Have them add together when clicking on "View Score" (and navigating to jump to "View Score Screen").

2. Then have it write back the score to the SharePoint list

(I created the radio button options and creating the quiz using the share Point list to create a form and converting to radio boxes - which worked really well.)  I have watched about 3 hours of different video and got this far, but can't seem to move beyond this and I'm soooo close to the end!  Please help!  

 

My View Score button currently has

/*Assigning Trip Score to radio button for calculations
*Q1*/

If(Radio01.Selected.Value = "Yes", Set(Score,10), Set(Score, 0));
If(Radio01.Selected.Value = "Partly", Set(Score,5), Set(Score, 0));
If(Radio01.Selected.Value = "No", Set(Score,0), Set(Score, 0));

/*Q2*/
If(Radio02.Selected.Value = "Day", Set(Score,0), Set(Score, 0));
If(Radio02.Selected.Value = "Partly", Set(Score,5), Set(Score, 0));
If(Radio02.Selected.Value = "Dark", Set(Score,20), Set(Score, 0));

/*Q3*/
If(Radio03.Selected.Value = "<4", Set(Score,100), Set(Score, 0));
If(Radio03.Selected.Value = "5 to 7", Set(Score,50), Set(Score, 0));
If(Radio03.Selected.Value = ">8", Set(Score,0), Set(Score, 0));

 

And my sharepoint list to write the values back looks like this - I have a total of 11 questions

RoxyRoller_0-1647460168882.png

 

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @RoxyRoller 

    My suggestion would be to start from the Radio controls themselves and introduce your scores there.

     

    For example, if you have a Radio01 control with a Yes, Partely, No option, then instead of setting the Items property to ["Yes", "Partly", "No"]  (which I am guessing you have), then set it to:

        Table({Value: "Yes", Score:10}, {Value: "Partly", Score: 5}, {Value: "No", Score: 0})

    Do the same for the other Radio controls.

     

    Finally, for your screen with the score, set a label with the Text property of:

        Sum([Radio01, Radio02, etc...], Value.Selected.Score)

     

    This will provide you the sum of all of the scores selected.

     

    This can also be included to write to your datasource.

     

    I hope this is helpful for you.

  • Cmugford Profile Picture
    43 on at

    Thank you so much @RandyHayes - I will give this a try - what you provided makes sense to me! 

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @RoxyRoller 

    Understanding that in your first app puts you way ahead of the curve!!

    Let me know if you run into issues with it.

  • Cmugford Profile Picture
    43 on at

    Ok, so I have inched forward and can display the value checking

    RoxyRoller_0-1647540168505.png

    But I can't get the total value to display in the label on the Total score on the next screen.  I have tried. Radio10.Selected.Score and  radio10.Selected.Value as well.  Again, I feel like I'm missing something so easy! 

    RoxyRoller_1-1647540242810.png

     

  • Verified answer
    Cmugford Profile Picture
    43 on at

    Got it working, not sure what I was doing before - but thanks again for before!
    Sum(Radio01.Selected.Score,Radio02.Selected.Score,Radio03.Selected.Score,Radio04.Selected.Score,Radio05.Selected.Score,Radio06.Selected.Score,Radio07.Selected.Score,Radio08.Selected.Score,Radio09.Selected.Score,Radio10.Selected.Score,Radio11.Selected.Score)

  • Verified answer
    RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @RoxyRoller 

    You can shorten that with:

    Sum([Radio01.Selected, Radio02.Selected, Radio03.Selected, Radio04.Selected,
     Radio05.Selected, Radio06.Selected, Radio07.Selected, Radio08.Selected, 
     Radio09.Selected, Radio10.Selected, Radio11.Selected], 
     Value.Score
    )

    Otherwise, you don't really need the sum function with your other formula, you could just add them together.

  • Cmugford Profile Picture
    43 on at

    Randy, could I trouble you for one more item? (but this pertains to email formatting and it's got me stuck. 

    I would like Value(CalcFinal.Text) to appear as a large 20x font and maybe "red".  Google has nothing, and everything I try outside of the "..." doesn't seem to work.

    RoxyRoller_0-1648665346643.png

     

     

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @RoxyRoller 

    Sure...

    "<br><span style='font-size:Large;color:red;font-weight:bold'>" & CalcFinal.Text & "</span><br> ...

     

    You don't need to use the Value function to convert text to a number to then put into text.  Just use the text.

     

  • Community Power Platform Member Profile Picture
    on at

    from there this sum command is use

  • SaraMME Profile Picture
    2 on at

    And, how can I send this results (the scores) to and excel sheet? I can't find the way... 

     

    Thanks a lot!!

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard