How to use a SWITCH into a workflow with Yes/No variable type from a catalog item ?

thomasnoret
Kilo Contributor

Hi guys,  

when using a variable like a "Select Box" I can retrieve with a SWITCH into a workflow all the choices available...

But while using this SWITCH function with a Yes / No variable type, it does not list automatically Yes, No as possibilities... Do you know why ?

Do I need to add a  condition by right clicking on the swith and putting a condition called "yes" and another one "no"  ?

OR should I need to create select box with Yes & No as choices ?

 

thanks a lot !

1 ACCEPTED SOLUTION

Can you please try with below script.



answer = ifScript();


function ifScript(){


if(current.variables.Corefa_UCM_BudgetOwner == 'Yes')


  return 'yes' ;


return 'no';


}


View solution in original post

16 REPLIES 16

i dont understand why ? in the catalog item form i have chose YES... and it is seenable on the variable logs on the RITM...


Can you please try with below script.



answer = ifScript();


function ifScript(){


if(current.variables.Corefa_UCM_BudgetOwner == 'Yes')


  return 'yes' ;


return 'no';


}


with this script on an IF it works...



but by adding a condition it does not on a switch.



so just to understand I would add a condition like   :


find_real_file.png


so while using this path with the switch it is KO... is my condition not right ?


find_real_file.png


also what do you mean by :


" Instead you can use switch condition easily: just select the variable and select the path it should follow based on variable value" ?



I have created a switch from my variable who is a YES/NO variable type but it shows only "Always" as a value... (not "no" or "yes")...


when I add 2 conditions manually to the switch: "yes" and "no" => nothing happens, the workflows stops to the switch with no selection found..



with a SWITCH + variable Select box / choices it works (example the first switch in my workflow...)


find_real_file.png


you can right click on switch and then add condition,



find_real_file.png