Setting Up A "Switch" or "Conditional Branch" Workflow. Connect To: = "Choice" in List


Hello Everyone,

I'm setting up a Workflow starting with a "Switch" or a "Conditional Branch."  The Workflow looks to a "Choice" column in SPO.  Seems straightforward - yet it's not cooperating (it will not run).  Is there something I'm missing?

Thank you!

 

 

 

 


18 replies

Userlevel 6
Badge +16

Hi @Underdog 


 


Here are some generic tips


 


1. Use Log to History to display the value of your List Item.


Use Log before and after the condition.


Help to identify the Choice value is define and saved correctly.


Help to identify the Condition is correctly set.


Help to identify any spelling or typo in the comparison field. "Heloo", "hELLO", " hello "



 


2. Identify the Datatype of the Value? Is it Text, Number or Decimal


 


Remember these are generic suggestions.


Should you need further help, pls share additional details


- what should the value be, what is the actual value, what is the condition etc


 


Cheers

Hi @Garrett,


Happy Friday to you and hope all is well.  Thank you for your initial thoughts.  Now I'll expand (and probably back-pedal a little) and describe the problem I'm facing.


 


My company would like me to use the below Control if possible.  It allows our members to select multiple departments.  Once selected, our company would like to send a notification e-mail to every department chosen.


 



The above Control uses a SPO Lookup (called "Portfolio").



The Lookup "Portfolio" lists the 13 departments:



 


So, first, is it even possible to use the above Control for e-mail notification to multiple departments, or should I set up a "Choice" control as below?



Second, do I use a Log to History function right at the start of the Workflow (per early comments)?


Third, do I set up a State Machine, Switch or Conditional Branch?


 


Thoughts when you have time.


Thanks!


 


 


 


 

Userlevel 6
Badge +16

Hi @Underdog 


 


That Control is a multi-select field which means that users can select multiple values. When you enable the multi-select, the result are stored in a collection variable.


 


Use a for-each loop to process the value.



 


Configure the For Each as follows


Input collection = <Your multi-select choice collection>


Output value = <Set a variable to contain one value>



 


If your choice just contains the Department Name (and not the email address), you will need a switch to check the department and assign the email address. Refer to image below



 


Cheers

Ok.  Let me look into your suggestion.  It's looks promising too ..  Thanks!


 

Userlevel 6
Badge +16

@Underdog 


The above structure will send 1 email per department.


If the multi-select has 5 department, it will loop 5 time and send 5 emails.


Great for personalizing the email for each department.


 


For better efficiency, concatenate the emails ($email = "dept1@company.com; dept2@company.com;  dept3@company.com") . Move the email action outside of the For-Each loop.


This will only send out 1 email. 


Great for optimizing performance by sending one generic email.



 

Ok.  I feel like I've got a lot of homework to do.  I'll be working on this until about 8:00 EST.  Then, possibly, over the weekend.  Thank you for the extensive insight!  I'll write and let you know how well I recreate your recipe .. lol .. ..


 


Ok.  Underdog has tried to chef your recipe.   I'm going to have to baby-step this process.


********************************************************************************************


I have recreated the structure of the concept.



Next:  The particulars.


 


"For Each":



 


"Log to History List":



 


"Switch":



 


"Set Variable":





 


"Log to History List":  (generic e-mail address)



 


"Send an E-mail":



 


Am I close?


Thanks!


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 

Userlevel 6
Badge +16

Hi @Underdog 


 


Hmmm. I'm not getting back the Portfolio Choices result as a Collection.


 


Form



SP column - "Portfolio" Choice, Multi-Select



 


Workflow - Log



Formatted as "Comma Delimited"



Log Results



Line 1 is as "Choices, Comma Delimited"


Line 2 is as "String"


 


Perhaps its how I assign the Choices? What result did you get?


 


 


 

Userlevel 6
Badge +16

Hi @Underdog 


 


It works exactly when I use NWC. Because the Choice Value is of Collection Type. 


 


Try it out


https://tmsolutions-358355.workflowcloud.com/forms/8dcc6736-a9c4-49de-89dd-4062337d2f42 


 


NOTE: You can only submit the form when you use your work email ID. 


 


NWC Workflow



 

Userlevel 6
Badge +16

Hi @Underdog 


Use a Log to History to capture the Choice Values.



What is the value that appears?


 


As String: {"__metadata":{"type":"Collection(Edm.String)"},"results":["AFS Leadership","ARC","Automation","Celonis","Data Auditing","Data Quality"]}
As Choice: AFS Leadership,ARC,Automation,Celonis,Data Auditing,Data Quality


 


Format the Choices value 



 

Hi Garrett,
Good morning. Working through your homework this morning. My brother is in town and I spent the weekend with his family.
Have a great Monday! I'll be in touch!
Userlevel 6
Badge +16

Hi @Underdog 


No worries, mate. Family first


 


Have a great week ahead

Ok.  I've tried to build the recommended structure skeleton ... 



 


... from ... below.



 



 


Regarding the configuration:


I believe I have the "For Each" correct.  Please correct me if I'm wrong.



 


The "Log to History" function.  Not sure if I've prepared correctly.  It's a function I don't understand.



 


 


 


 


 


 


 

Userlevel 6
Badge +16

Yes, the Log to history is correct


What is the value?

Value.  Is that the Department? AFS Leadership, ARC, Audit ... etc.

Userlevel 6
Badge +16

Did you get this either one of this?



We want to get result back as String

Ok. Here's what I have so far:


 


Structure:



 


"Loop for Each".  I believe I have this right.



 


"Log to Instance/History".  I believe I have this right.



 


"Create a Text String".  This - I'm not sure I have it right.



 


I have more, but I want to get the initial steps right.


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 

Hi Garrett,


If you're free at 9:00 a.m. your time, I would be available tonight for coaching.


Thanks.


 

Reply