Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

How to use 'Contains' condition in workflow switch activity outcome

Wasdom_Kung
Tera Guru

Hello,

Hopefully an easy one but it has escaped me, the overall condition is that if a reference field in the change request = Process 1A Network, go to the following in the workflow.

I want to change this to if the reference field on the change request contains Process 1, go to the following in the workflow.


Currently I have this in place as an option that works:

 

current.u_process=='Process 1A Network'

 


However I want to remove multiple choices and have it always succeed if the choice contains "Process 1".

 

How would I achieve this? I thought the following would work but it doesn't, thanks!

 

current.u_process*'Process 1'

 

 

1 ACCEPTED SOLUTION

Wasdom_Kung
Tera Guru

Decided to go with a simple condition that checks for Process 2, if it's not then follow another route.

 

Process type is not 2:

 

current.u_process!='Process 2 (CAB)'

 

 

Process type is 2:

 

current.u_process=='Process 2 (CAB)'

 

 

View solution in original post

3 REPLIES 3

Dan Ostler
Tera Guru

Without knowing more about the custom field that you are using I can't provide a more thorough answer. Although I believe this script should work for the need you have outlined:

 

if (current.u_process.indexOf('Process 1') > -1) {}

 

The field in question populates a value depending on the selected CI and the impact of the change request, I've tested your provided script, but it doesn't appear to work as expected.

Edit: It may actually work, looks like there's another issue that has become apparent, I'll let you know if it has worked once that's sorted.

 

For example, there are 4 values Process 1A, Process 1B, Process 1C and Process 1D, the workflow is still correctly working out which process is on the form but it isn't moving as expected afterwards:

Wasdom_Kung_0-1666167294136.png

 



Wasdom_Kung
Tera Guru

Decided to go with a simple condition that checks for Process 2, if it's not then follow another route.

 

Process type is not 2:

 

current.u_process!='Process 2 (CAB)'

 

 

Process type is 2:

 

current.u_process=='Process 2 (CAB)'