SOLVED

Increment score based on responses using Power Automate

%3CLINGO-SUB%20id%3D%22%5C%26quot%3Blingo-sub-3158580%5C%26quot%3B%22%20slang%3D%22%5C%26quot%3Ben-US%5C%26quot%3B%22%3EIncrement%20score%20based%20on%20responses%20using%20Power%20Automate%26lt%3B%5C%2Flingo-sub%26gt%3B%3CLINGO-BODY%20id%3D%22%5C%26quot%3Blingo-body-3158580%5C%26quot%3B%22%20slang%3D%22%5C%26quot%3Ben-US%5C%26quot%3B%22%3E%3CP%3EHello%2C%26lt%3B%5C%2FP%26gt%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%3C%2FP%3E%3CP%3EI%20have%20created%20a%20form%20using%20Microsoft%20Forms%20that%20asks%20a%20user%20a%20few%20questions.%20I%20am%20using%20power%20automate%20to%20assign%20a%20value%20to%20each%20response%20based%20on%20what%20the%20user%20selects%2C%20and%20at%20the%20end%2C%20once%20they%20submit%20the%20form%20the%20score%20is%20accumulated%20and%20stored%20in%20a%20sharepoint%20list.%20The%20problem%20is%2C%20each%20answer%20has%20a%20different%20score%20attributed%20to%20it%2C%20and%20it%20does%20not%20seem%20to%20be%20adding%20them%20correctly.%20To%20make%20the%20flow%20easier%2C%20I%20made%20conditions%20based%20on%20the%20points%20(1-5)%2C%20as%20shown%20below%20as%20an%20example%3A%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22%5C%26quot%3Blia-inline-image-display-wrapper%22%20lia-image-align-center%3D%22%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Fgxcuf89792%2F%5C%26quot%3Bhttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F347557i2AA6ECB4DF20B6AB%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%5C%26quot%3B%22%20role%3D%22%5C%26quot%3Bbutton%5C%26quot%3B%22%20title%3D%22hs1ngh_0-1644711702395.png%22%20alt%3D%22%5C%26quot%3Bhs1ngh_0-1644711702395.png%5C%26quot%3B%22%20%2F%3E%26lt%3B%5C%2Fspan%26gt%3B%26lt%3B%5C%2FP%26gt%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%3C%2FP%3E%3CP%3EI%20am%20also%20attaching%20the%20scoring%20formula%20I%20am%20intending%20on%20using%3A%26lt%3B%5C%2FP%26gt%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22%5C%26quot%3Blia-inline-image-display-wrapper%22%20lia-image-align-center%3D%22%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Fgxcuf89792%2F%5C%26quot%3Bhttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F347558i6698F7497C34EE57%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%5C%26quot%3B%22%20role%3D%22%5C%26quot%3Bbutton%5C%26quot%3B%22%20title%3D%22hs1ngh_1-1644711758177.png%22%20alt%3D%22%5C%26quot%3Bhs1ngh_1-1644711758177.png%5C%26quot%3B%22%20%2F%3E%26lt%3B%5C%2Fspan%26gt%3B%26lt%3B%5C%2FP%26gt%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EThe%20problem%20as%20stated%20is%20that%20the%20scores%20never%20add%20up%20correctly.%20If%20I%20am%20selecting%20more%20than%20one%20three%20point%20question%20in%20different%20sections%20or%20even%20the%20same%2C%20it%20doesn't%20add%20it%20all%20and%20I%20instead%20get%20a%20lower%20score%20than%20I%20should%20be.%20I%20don't%20want%20to%20have%20to%20create%20a%20bunch%20of%20conditions%20(that%20seems%20to%20be%20the%20only%20solution)%20so%20is%20there%20something%20wrong%20with%20the%20logic%20or%20is%20there%20an%20alternative%3F%26lt%3B%5C%2FP%26gt%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%3C%2FP%3E%3CP%3EThanks%20in%20advance.%26lt%3B%5C%2FP%26gt%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%26lt%3B%5C%2Flingo-body%26gt%3B%3CLINGO-LABS%20id%3D%22%5C%26quot%3Blingo-labs-3158580%5C%26quot%3B%22%20slang%3D%22%5C%26quot%3Ben-US%5C%26quot%3B%22%3E%3CLINGO-LABEL%3EFlow%26lt%3B%5C%2Flingo-label%26gt%3B%3CLINGO-LABEL%3EForms%26lt%3B%5C%2Flingo-label%26gt%3B%3CLINGO-LABEL%3EPower%20Automate%26lt%3B%5C%2Flingo-label%26gt%3B%26lt%3B%5C%2Flingo-labs%26gt%3B%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3C%2FLINGO-SUB%3E
Visitor

Hello,

 

I have created a form using Microsoft Forms that asks a user a few questions. I am using power automate to assign a value to each response based on what the user selects, and at the end, once they submit the form the score is accumulated and stored in a sharepoint list. The problem is, each answer has a different score attributed to it, and it does not seem to be adding them correctly. To make the flow easier, I made conditions based on the points (1-5), as shown below as an example: 

hs1ngh_0-1644711702395.png

 

I am also attaching the scoring formula I am intending on using:

hs1ngh_1-1644711758177.png

The problem as stated is that the scores never add up correctly. If I am selecting more than one three point question in different sections or even the same, it doesn't add it all and I instead get a lower score than I should be. I don't want to have to create a bunch of conditions (that seems to be the only solution) so is there something wrong with the logic or is there an alternative?

 

Thanks in advance.

 

1 Reply
best response confirmed by hs1ngh (Visitor)
Solution

@hs1ngh your condition won't work because it will apply the increment of 3 points only once if it finds that any of the multi choice answers have been selected. It doesn't loop through them and add it each time an answer has been selected. So  the user might select 3 answers but it will only add 3 points. 

 

But you can get it to work very well using a combination of a Switch control for the single answer questions and a condition for each of the multiple answers. The example shown below uses your scoring and it only took about 15 minutes to build the form, the flow and the list.

 

The overall flow looks like this:

0a-Overall.png

 

0b-Overall.png

 

 

This example uses your questions and scoring method. First is the form:

0-Form.png

etc etc

 

Looking at the flow in detail there is the trigger, the get response details action and we've initialized the variable as a float to hold the score:

 

1-Flow.png

 

Question 1 only has a single choice. So you can use a Switch control which is a type of condition that looks at the question and in case it equals IT for example then increment the variable by 4, in case the answer equals Cyber then increment the variable by 5  and so on.

 

2-Flow.png

 

But question 2 is a multi choice question so you can't use a switch control. Instead, add a condition and if the question contains Passion then increment the variable by 3. You can copy the condition to your clipboard and use it for each of the other possible answers, changing the right hand box and the increment value as appropriate.

 

3-Flow.png

 

The same applies to Question 3 which also allows multiple answers:

 

4-Flow.png

 

Question 4 is  a single answert question so again you can use a switch control.

 

5-Flow.png

 

And the same with Question 5:

 

6-Flow.png

 

Finally, add the create item action and select the variable for the total and the text for question 6. I haven't dealt with the uploaded file in this example as your main concern was the total value.

 

7-Flow.png

 

The form was completed and the flow ran successfully & quickly and recorded the correct overall points total in the list.

 

8-SP-List.png

 

Come back with any questions about this.

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User