Score based on answers

%3CLINGO-SUB%20id%3D%22lingo-sub-1931653%22%20slang%3D%22en-US%22%3EScore%20based%20on%20answers%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1931653%22%20slang%3D%22en-US%22%3EI%20am%20trying%20to%20create%20a%20form%20that%20based%20on%20the%20submitters%20answers%20(choice%20field)%20creates%20a%20score%20and%20subsequently%20a%20priority%20(H%2CM%2CL)%3CBR%20%2F%3E%3CBR%20%2F%3EDoes%20anyone%20know%20how%20to%20do%20this%3F%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1931653%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EForms%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Visitor
I am trying to create a form that based on the submitters answers (choice field) creates a score and subsequently a priority (H,M,L)

Does anyone know how to do this?
1 Reply

@Kmaso1 you won't be able to do this with just Forms but will need a relatively simple flow in Power Automate to add up the score and apply the priority value and add the result to a table in a different Excel spreadsheet. The result of my example looks like this:

Spreadsheet-Result.png

 

In this example the Form has 5 questions with 5 possible answers, only 1 of which is correct:

 

Q1.png

 

Q2-3.png

 

Q4-5.png

 

You the build the flow in Power Automate as follows:

 

1. Add a Forms When a new response is submitted trigger followed by the Get response details action. Next add an Office 365 Users Get user profile (v2) action as we'll just add the firstname of the responder into the spreadsheet. But you could omit this step and add the Responder's email address into the spreadsheet instead.

 

F1.png

 

2. You now need to add 2 initialize variable actions for the score (an integer type) and the priority( a string type):

 

F2.png

 

3. Next add a condition for Question 1, select the question from the dynamic content box on the right when you click in the field, select is equal to, then type in the correct answer. In the green If yes channel we want to increase the score by 1 so add an Increment variable action and set the value to 1. Leave the red if no channel empty.

 

F3.png

 

You then need to add a condition the same as for question 1 for all the other questions. I have not done screenshots for these other questions as the only difference is the question and answer in the condition.

 

4. Next we want to look at what the score is and apply a priority to it. In this example I've assumed that a score of 5 gives a priority of H, 2-4 gives M and less than 2 gives L. So add another condition and in the left hand box select varScore from the dynamic content, then select is equal to, then type in 5. In the green if yes channel add a Set variable action and set the value to H.

F4.png

 

5. In the red if no channel add another condition and in the left box select varScore from the dynamic content then select is greater than or equal to and type in 2. Then click the Add button to add another row where you select varScore is less than or equal to 4.

In the green if yes channel add another Set variable action and set the value to M. In the red if no channel add another Set variable action and set the value to L (you can copy actions to your clipboard to make adding actions quicker).

 

F5.png

 

6. Add a new step after all the conditions and add the Excel for Business Add a row into a table action and in the Name column I've just selected the Given name from the dynamic content, then the varScore for the Score and the varPriority for the priority.

 

F6.png

 

I hope the description and screenshots are clear but come back with any questions about this.

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User