Forum Discussion
Increment score based on responses using Power Automate
- Feb 13, 2022
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:
This example uses your questions and scoring method. First is the form:
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:
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.
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.
The same applies to Question 3 which also allows multiple answers:
Question 4 is a single answert question so again you can use a switch control.
And the same with Question 5:
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.
The form was completed and the flow ran successfully & quickly and recorded the correct overall points total in the list.
Come back with any questions about this.
Rob
Los Gallardos
Microsoft Power Automate Community Super User
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:
This example uses your questions and scoring method. First is the form:
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:
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.
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.
The same applies to Question 3 which also allows multiple answers:
Question 4 is a single answert question so again you can use a switch control.
And the same with Question 5:
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.
The form was completed and the flow ran successfully & quickly and recorded the correct overall points total in the list.
Come back with any questions about this.
Rob
Los Gallardos
Microsoft Power Automate Community Super User
- DW_ElementFeb 03, 2023Copper Contributor
Thanks for this RobElliott
The only thing I'll add is you need to put quotation marks around your Case Equals variable.
i.e. Case 4 Equals "Fresher".
Otherwise the flow won't work.