If-Else on Workflows?

Hello, is this a possible option.

the workflow we want is such:

Trigger: account modified date is last 5 minutes
If account type is type1
then send email A
Else if account type Type2
then send email B
else
send email C

can this be done through a single workflow?

If not is there a chain of workflows you can think of which would be able to work this functionality?

Workflow currently only works with AND operators so cannot currently do AND/OR statements/conditions.

Thanks,

Will.

So can you think of a hypothetical chain for it or is there a better way to do this?

You could set up individual workflows for each condition and then set up the particular action.

This would mean each condition would be handled and the separate emails sent.

Thanks,

Will.

Old post I know, but still very relevant.

Do you know where the logic for the AND (&&) operator lives? I’m interested in this too and may try to tackle it in a test environment. It should be as simple as adding a button to change operator in a drop down and apply a function based on operator selected. If no one knows I can dig.

I agree this would be useful, but an OR operator wouldn’t suffice. This would let you do “if A or B then action”, but what is asked here is “if A then actionA else actionB”, which is different.

One way to implement this would be to number the different conditions, and then in the actions have an extra dropdown to select which condition it ties into to.

Like this:

Conditions:

1 Condition A
2 Condition B
3 Condition C

Actions:

Condition 1 --> some action
Condition 2 --> some other action

But this could get complicated, sometimes conditions are made of more than one condition (combined with AND) and sometimes actions are more than one for each condition. Still, it should be doable.

Almost feel like multiple conditions could be indexed in an array (if possible to store array data like that in MySQL(pretty sure it is), will have to look into that) and actions the same. World of possibilities and way more efficient

Something like


If ($condition[1]) {     // or If($condition{1,2,3,4..... and so on)
     $action[1,2,3];
} else {
     $action[4];
}

Where the array index would reference the condition ID’s and action ID’s I assume

Or

If ($condition[1]) {     // or If($condition{1,2,3,4..... and so on)
     $action[1,2,3];
} else if ($condition[5,6,7])
 {
     $action[4];
}

Might be way off, but seems feasible off the top of my head.