Branching/Cases in Automation Rules

I was searching the forum and wasn’t able to find a discussion about branching in automations. What I mean by this is the ability to check for a number of conditions and apply a different action based on the circumstances. I know this can become complicated quickly and that you can use scripts to achieve any type of flow required. However, I was thinking that in the cases when the rule is invoked when a particular field is changes, it would make sense to contain all the different cases in one rule.

For example, I have a task database which has workflow states (Created, Assigned, In Progress, Done). Right now, I have two separate rules which react to a change in the workflow:

  • When workflow is changed to “In Progress”, I set the Start Date
  • When workflow is changed to “Done”, I set the End Date

I think given that both of these are basically just monitoring changes to the workflow field, they can just be encapsulated into one rule. I think of this as being equivalent to JavaScript’s switch case conditions.

Voted. :+1:

If an example / reference is needed Airtable recently added conditional logic to allow for more complex workflows:

1 Like

Not directly connected to the topic, but in your particular case you can still go with 1 Rule using a some kind of workaround with IF’s that formulas provide:

StartDate field – use following formula to set this field: If(State.name = “in Progress”, Now(), [Step 1 {“Your database name here”].StartDate).
EndDate field – use following formula to set this field: If(State.name = “Done”, Now(), [Step 1 {Your database name here"}].EndDate)

I used “Now()” for example purposes, use value you need to set.

1 Like