Brook0131
Canvas Initiate

Using Switch with check boxes on Form

Jump to solution

I need to be able to send various emails depending on which rate segment is selected on a form. The field is a check box that can be multi-selected. I am currently using switch and I know that switch can only use text or list ids. What would be the best and easiest approach to be able to send specific emails to each rate segment? Right now my workflow just skips entirely over the switch actions. Please see workflow screenshot attached. 

0 Kudos
Reply
4 Replies
Aleximo
Forms Fledgling

Re: Using Switch with check boxes on Form

Jump to solution

hey,

 

dont know if that would be an option for u, but i would work with "for each element"

 

it looks a bit clumsy but it works. let me know if ur interested and i explain it in detail:

 

Aleximo_0-1618403995087.png

 

0 Kudos
Reply
Brook0131
Canvas Initiate

Re: Using Switch with check boxes on Form

Jump to solution
yes I am interested! Please give me as much detail as possible so I can configure it correctly! Thank you!
0 Kudos
Reply
Aleximo
Forms Fledgling

Re: Using Switch with check boxes on Form

Jump to solution

okay.

 

so first u have to lookup the value from ur multiple choice field and save it in a collection varible (CollTopic)

 

Aleximo_4-1618406834370.png

 

 

Aleximo_1-1618406648442.png

 

Aleximo_3-1618406754862.png

 

 

after that u have to split ur values in the collection variable (CollTopic) and save the new values in another collection variable (or in the same CollTopic like i do)

 

Aleximo_5-1618406867050.png

 

 

Aleximo_2-1618406721134.png

 

now the last step:

 

Aleximo_6-1618406960104.png

 

in the for each element u have to create two variables one text and one YES/NO variable and set it up like this:

 

Aleximo_12-1618407346307.png

 

 

Aleximo_7-1618407070005.png

in the first "if else" we check if the varSingleValueTopic is empty:

 

Aleximo_10-1618407237172.png

 

 

Aleximo_8-1618407156453.png

if the variable is empty it will go to the right and set the YES / NO variable to Yes (this will stop the loop "for each"):

 

Aleximo_11-1618407255498.png

 

 

Aleximo_9-1618407224235.png

 

 

now the part is a bit repetitive... u have to do this step for each of ur single values that are possible to choose (PGS, Azusa, Space Components, Astro, Launch Vehicles, LV-MDS):

 

my example is for PGS:

 

Aleximo_13-1618407522179.png

 

set up the "if else" like this:

 

check if the text variable (varSingleValueTopic)  --- CONTAINS --- the value: PGS .... if its yes make an email notification on the "yes" path. if not then go to next "if else" and check if the text variable --- CONTAINS --- the value: Azusa.... and so on till all 6 are complete.

 

Aleximo_14-1618407563448.png

 

 

 

thats it.

 

let me know if u have any questions.

 

 

View solution in original post

Reply
kunalpatel
Automation Master
Automation Master

Re: Using Switch with check boxes on Form

Jump to solution

@Brook0131@Aleximo instead of hard coding everything in a workflow, below is my dynamic approach:

 

Create another list (restricted for the edit to certain users) and read-only for others. This will have the following columns:

  1. Rate Segment
  2. Subject (You can create the HTML code for common, item property, and workflow variable) or hard code the subject
  3. Body (You can create the HTML code for common, item property, and workflow variable) or hard code the message.

In your workflow:

  1. Using RegEx store rate segment choices in a collection variable
  2. Using For Loop for each value in the above collection:
    1. Using Query list query above list (filter using the current rate segment from a for loop) and get Subject & Body and store them in appropriate variables and NOT collection variables. (you can also create To, CC or BCC if needed and query them too). Make sure you specify "1" in Specify item limit field. 
    2. Using Send notification action configure appropriate fields using data from the above Query List and/or item properties.

This will reduce the current complexity in the workflow and if there are new choices or current choices are no longer needed then it's easily scalable.

 

 

0 Kudos
Reply