cancel
Showing results for
Did you mean:
Helper III

## List values for end score

Hello,

I am building an app where I will have about 9 drop downs, each with the same fields: YES, NO, N/A and I want them to be weighed/valued the same as:

YES = 1

NO = 0

N/A = No value

Then I need to figure out a way to have a 'score' field tally up the total from all 9 drop downs to give me a composite score (and then ultimately a percentage).  I'm sure this is possible, but I am not sure how to start this.

Any guidance or support is appreciated.

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
Super User

Here's one way, of many.

I made 9 dropdowns, each with items of ["YES", "NO", "N/A"]

each ones onchange had the following code

Switch(q1.Selected.Value,
"YES",Set(PointCount1,1);Set(TotalCount1,1),
"NO",Set(PointCount1,0);Set(TotalCount1,1),
"N/A",Set(PointCount1,0);Set(TotalCount1,0));

Set(RunningScore, Sum(PointCount1,PointCount2,PointCount3,PointCount4,PointCount5,PointCount6,PointCount7,PointCount8,PointCount9));
Set(RunnignQuestionCount, Sum(TotalCount1,TotalCount2,TotalCount3,TotalCount4,TotalCount5,TotalCount6,TotalCount7,TotalCount8,TotalCount9))

(except the 1 becomes 2 3 4 5 6 7 8 9 respectively for each subsequent dropdown so they each have and maintain their own individual counts)

next to them i have 3 labels, text of each is below

"Total Yes: "&RunningScore

"Total Questions: "&RunnignQuestionCount

"Score: "&RoundDown(RunningScore/RunnignQuestionCount*100,0)&"%"
_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!
7 REPLIES 7
Super User

Here's one way, of many.

I made 9 dropdowns, each with items of ["YES", "NO", "N/A"]

each ones onchange had the following code

Switch(q1.Selected.Value,
"YES",Set(PointCount1,1);Set(TotalCount1,1),
"NO",Set(PointCount1,0);Set(TotalCount1,1),
"N/A",Set(PointCount1,0);Set(TotalCount1,0));

Set(RunningScore, Sum(PointCount1,PointCount2,PointCount3,PointCount4,PointCount5,PointCount6,PointCount7,PointCount8,PointCount9));
Set(RunnignQuestionCount, Sum(TotalCount1,TotalCount2,TotalCount3,TotalCount4,TotalCount5,TotalCount6,TotalCount7,TotalCount8,TotalCount9))

(except the 1 becomes 2 3 4 5 6 7 8 9 respectively for each subsequent dropdown so they each have and maintain their own individual counts)

next to them i have 3 labels, text of each is below

"Total Yes: "&RunningScore

"Total Questions: "&RunnignQuestionCount

"Score: "&RoundDown(RunningScore/RunnignQuestionCount*100,0)&"%"
_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!
Helper III

Hey Rob,

Thank you so much!  I appreciate the detailed response.  I do have some questions as I may need this broken down a bit for me.   Would you be able to share more of your setup as I think it would be easier for me to understand if it were broken up and simplified.

For example, I wasn't sure what 'q1' was in the 'onchange' part (I assume question 1, but wasn't sure how that fit).

Just any additional guidance is appreciated.

Thank you again

Helper III

Rob - I should have waited for the coffee to set in.  I applied it and that works perfectly!  Thank you so much!  I may need to reach back out as I go further here, but so far I think this will work for what I need.

Thank you again!

Helper III

Question:

This works great, but I want it with just the percentage.  I tried to remove the 'Total' but then it does not work.  Is there a way to have a field just yield the percentage and not "total: 100%"?

Thank you!

Super User

remove the total: bit, and also the & after it

_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!
Regular Visitor
I have the exact same task to complete, but getting an error in "On change" for whatever reason. Q1 is your data card value, correct?
Helper III

Sorry, I'm not 100% sure of your question - but this solution worked for me.

Announcements

#### April 4th Copilot Studio Coffee Chat | Recording Now Available

Did you miss the Copilot Studio Coffee Chat on April 4th? This exciting and informative session with Dewain Robinson and Gary Pretty is now available to watch in our Community Galleries!   This AMA discussed how Copilot Studio is using the conversational AI-powered technology to aid and assist in the building of chatbots. Dewain is a Principal Program Manager with Copilot Studio. Gary is a Principal Program Manager with Copilot Studio and Conversational AI. Both of them had great insights to share with the community and answered some very interesting questions!     As part of our ongoing Coffee Chat AMA series, this engaging session gives the Community the unique opportunity to learn more about the latest Power Platform Copilot plans, where we’ll focus, and gain insight into upcoming features. We’re looking forward to hearing from the community at the next AMA, so hang on to your questions!   Watch the recording in the Gallery today: April 4th Copilot Studio Coffee Chat AMA