Add 3rd condition in a workflow if condition using add condition

BALAJI K R
Tera Expert

Hi, 

 

I tried adding a 3rd condition to a if condition in a workflow to return 'both' (like return no; & return yes;).
I wrote a script with 3 returns for diff conditions;

script example:

if(a=b){

return yes;

}else if(b=c){

return no;

} else if (c=d){

return both;

}

 

also in the 3rd condition property added : Condition as activity.result='both';

 

I added logs to check if the script is accessing the if clause to return both, even though the script is accessing the if clause, the condition is returning no.

 

Is there any pre defined return values that are only to be used? please let me know.

BALAJIKR_0-1686896720894.png 

BALAJIKR_1-1686896783943.png

 

 

1 REPLY 1

John Dewhurst
Kilo Guru

Change it to a script activity and set the activity.result value directly like (not going to worry about what your example script is supposed to do)...

activity.result = (function(){
  if(a==b)
    return "yes";
  if(b==c){
    return "no";
  if (c==d){
    return "both";
  return ""
})()