I wonder if someone could advise, I'm struggling to find an efficient way to create an employee performance tracker, without creating a million variables and compose objects. This is mostly just my lack of experience with expression formulation.
I have an MS form that I'm outputting to flow to add to a Sharepoint list and email results in a table. I'm sending the following string values to my flow:
There are 5 possible outputs from the questions:
Not yet
Occasionally / Somewhat
Often
Mostly
Always
In the flow I want to convert these to integers to be able to show a section average - which I have achieved below.
if(equals(variables('A1'),'Always'),int('5'),if(equals(variables('A1'),'Mostly'),int('4'),if(equals(variables('A1'),'Often'),int('3'),if(equals(variables('A1'),'Occasionally'),int('2'),if(equals(variables('A1'),'Somewhat'),int('2'),if(equals(variables('A1'),'Rarely or Not yet'),int('1'),''))))))
I am then setting the output of this back to the original string variable. I am doing this for every single question which seems ridiculous but I don't know another way. Any suggestions with code examples on how to improve this would be amazing - I feel like I just need a global function that I could call..
I then want to add them all together and divide them by the number of questions in the section to get a mean average. This isn't working at the moment as I *think* it still thinks the variable is a string not an INT - not sure what I am doing wrong here..
Finally, the icing on the cake would be to convert the average score back to one of the corresponding levels below so that it's more meaningful when output into an email.
Level 1 - New
Level 2 - Learning
Level 3 - Developing
Level 4 - Mastering
Level 5 - Mastery
Any help would be amazing - TIA