We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

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

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


When I look at my Switch operators for Yes/No Variables, the conditions are:



activity.result == 'yes'


and


activity.result == 'no'


 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn