Skip to main content

Hello everyone & good morning.

I need help setting up a Switch function at the beginning of my Workflow.  Switches are easy and straightforward, but with one little problem.  It requests a "Select the variable to evaluate."  Since I want the Switch to choose the List Name of "Problems", there is no variable to choose from, since that is the List's name.

Any thoughts?

Thank you.

24496i19A7B31AC86355CB.png

24497iCF5645C36B3F3A13.png

 

hi @Underdog 



 



Can you explain what is it that you want to accomplish?


The Switch action is part of the Workflow Logic and Flow group. Other similar action include Run If and Conditional Branch 



 



Illustrating using the value of Priority column (Low, Medium, High)



 



Run If (Assess 1 condition) - Run only when condition is met



example Run If - Priority equals High





 



Conditional Branch (Assess 2 condition. IF and ELSE)





The YES path is taken when Priority equals High



The NO path is taken when the Priority equals Low or Medium



 



SWITCH (Assess multiple conditions)





The LOW path is taken when Priority equals Low.



The MEDIUM path is taken when Priority equals Medium.



The HIGH path is taken when Priority equals High.



 



 



 



 


Hi Garrett,



Thanks for the response.  I have seven questions that will be attached to the Switch (in my example I just used two for brevity).  But my dilemma is I need to connect the "Problems" List with the Switch, which I'm unable to do.



Thoughts?



 



Switch with seven questions:





 



To set up Switch "Select the variable to evaluate."  The "Problems" List is not a variable and I am unable to choose it.







 



 



 



 


The SWITCH action is not for switching List.



 



The SWITCH is for evaluating a (workflow variable / list lookup / workflow context) value.



example: is the Priority - Low, Medium or High



 



The SWITCH will only take 1 path and ignore the rest.



 



I think what you want to do is to evaluate all 7 questions - A State Machine action probably fits your need better.





 



Can you list down step-by-step what you wish to do?
Can you provide example data - like the 2 records of the list?



 


Thanks Garrett.  Let me look at your recommendation and get back to you.


Hi Garrett,



The seven questions are asked on a Form (screenshot at the bottom).  Each question has four responses (answers).  Each answer has a number assigned to it (0,1,3,9).  My task is to translate the text answer into a number for each question, then tally all seven amounts into one amount, then apply that amount to a calculated priority text = "None", "Low", "Medium" & "High".



For instance, if all seven questions received Response #2, then each question would have a value of "1".  The tally total = 7.



ie. 



Question #1:  Response #2 = 1



Question #2:  Response #2 = 1



Question #3:  Response #2 = 1



Question #4:  Response #2 = 1



Question #5:  Response #2 = 1



Question #6:  Response #2 = 1



Question #7:  Response #2 = 1



                                  Tally = 7



                                         7 = "Low" Priority



I need a function that will evaluate all seven questions.



 



List:  "Problems"



  Question:  Impact of the effort



    Response #1:  0|Neither driven by or impacted to business initiative



    Response #2:  1|Required to implement business initiative but no specific timeline identified



    Response #3:  3|Required to implement business initiative and a specific timeline identified



    Response #4:  9|Required to implement business decision



  Question:  High level estimate of associated savings



    Response #1:  0|No Improvement associated with effort



    Response #2:  1|$2,000 or less per year



    Response #3:  3|$10,000 or more per year



    Response #4:  9|Greater than $2,000 and less than $10,000 per year



  Question:  Revenue increase or expense reduction



    Response #1:  0|No savings expected.



    Response #2:  1|$2,000 or less per year.



    Response #3:  3|Greater the $2,000 and less than $10,000 per year.



    Response #4:  9|$10,000 or more per year.



  Question:  Risk Avoidance



    Response #1:  0|No risk avoidance.



    Response #2:  1|Minimal risk avoided in 1 or more of the following areas.



    Response #3:  3|Moderate risk avoided in 1 or more of the following areas.



    Response #4:  9|Major risk avoided in 1 or more of the following areas.



  Question:  Initiative Cost



    Response #1:  0|No estimate cost.



    Response #2:  1|Greater than $10,000.



    Response #3:  3|Greater than $2,000 less that $10,000.



    Response #4:  9|Less than $2,000.



  Question:  Complexity & Implementation Risk



    Response #1:  0|Uncertain of interdependencies, level of effort, and complexity.



    Response #2:  1|High Complexity; significant interdependencies with other projects, programs, or teams.



    Response #3:  3|Medium complexity; few interdependencies with other projects, programs, or teams.



    Response #4:  9|Low complexity; minimal or no interdependencies with other projects, programs, or teams.



  Question:  Urgency



    Response #1:  0|Not provided.



    Response #2:  1|No specific timeline has been identified for implementation.



    Response #3:  3|Timeline to implement is flexible.



    Response #4:  9|Timeline to implement can not be negotiated.



Thoughts?



 





 



 


State Machine.  Seven Questions.









 


Hi @Underdog 



 



Let says below is your partial list for 3 Users responses (you may have other columns)









































































































ID UserName Ans1 Ans2 Ans3 Ans4 Ans5 Ans6 Ans7 Score
1 User1 0 0 0 0 0 0 0  
2 User2 1 1 1 1 1 1 1  
3 User3 3 3 3 3 3 3 3  


Ans1 - Ans7 (This is the response 1-7)



Question: What value do you save as?  A|B|C|D or 1|2|3|4 or 0|1|3|9 (as text)



 



STEPS



1. Create a integer variable "intScore". Assign 0 (zero) to it





2a. Evaluate Ans1 with a Switch (I'm storing Responses as A|B|C|D)

























































ID UserName Ans1 Ans2 Ans3 Ans4 Ans5 Ans6 Ans7 Score
1 User1 A B C A B C D  






2b. We assign a value for the answer intPoint. (similar to step 1)



2c. Then we perform some maths. IntScore = IntScore + IntPoints





3. Copy the Switch and the DoCalc for the other 6 Answers.



4. Save the final Score to the SP Score column



 



Hope that helps



 



 



 



 



 


Whew.  That's a lot!  Well .. let me look at that information you've sent me.  Thank you!



 




 


Hi @Underdog 



 



How was my suggestions? Did it help to resolve your enquiry?



Let me know if you need further assistance, clarification or explanation.



 



Cheers 


Hi Garrett,



So far, the suggestions look good.  I've attempted to complete my Workflow with the concept I had in mind, blending suggestions you've made - the big one being the State Machine.  THAT was of great help.  I've written out the Workflow in long-hand.  I know your suggestions will substantially reduce the coding .. but I'll have to take them up on a second pass.  I've got the flow to sum a score from the seven questions, and summarily send me an e-mail with said score.  My last item I'm working on is taking that score number and translating into text: "None", "Low", "Medium" & "High".



If you have any pointers, that would be greatly appreciated.



Gratefully yours,



Brian



 



 


Hi @Underdog aka Brian



 



Easy one, here you go



 



You have 4 values - "None", "Low", "Medium" & "High"



I'm not certain what score goes where.



so I assign the values as follows



- 75 or more => High



- 50-74 => Medium



- 25-49 => Low



- Below 25 => None



 



Solution: Nested Conditional Branch



The variable txtOutcome is used to store the "None", "Low", "Medium" & "High" value



For the Second and Third, there is no need to state both conditions [score is >= 50 and < 75], this is already state as the NO path from the previous Branch. Understand?



 



First Branch: Evaluates whether score is >= 75



Yes: Assign txtOutcome equals HIGH



No: Second Branch (Score is < 75)



 



Second Branch: Evaluates whether score is >= 50



Yes: Assign txtOutcome equals MEDIUM



No: Third Branch



 



Third Branch: Evaluates whether score is >= 25



Yes: Assign txtOutcome equals LOW



No: Assign txtOutcome equals NONE



 





 



Let me know if you need any clarification on this Nested Branch thing



 



Cheers


Hi @Underdog 



How did you end up with 28 variables?



https://community.nintex.com/t5/Nintex-for-Office-365-Forum/Summing-Variables-Summing-28-Variables-with-a-Function/td-p/221400



 



I am only using 2 variables POINT and SCORE. There is 7 Do Calc actions.



You can basically copy the structure of Question 1 to create more questions.



 



You have 7 questions and each questions has 4 possible answers? 7Q x 4Ans = 28 variables?



 



Just curious



 



Cheers



 


Hi Garrett,



Well .. I've created a working flow that works.  So much of what you've advised has really helped me out.  Once the folks here sign off on the workflow, then I'm going back to incorporate more of your suggestions, which will improve the flow.  The variable "Conditional Branch" was the cherry on top of the cake and helped finalize the workflow .. handling correctly the summation of the 28 variables.



 



So, I've got my homework .. and many, many thanks.  If there's someone I can write to express my gratitude on your behalf, please give me their contact information.



 



All the best to you!



Brian



(Underdog)



 



 



 



 



 



 



 


Hi @Underdog aka Brian



 



Great news!!



 


Excellent.  Done.  Will do!



 


Reply