# Branching/Cases in Automation Rules

**URL:** https://community.fibery.io/t/branching-cases-in-automation-rules/2469
**Category:** Ideas & Features
**Tags:** automations
**Created:** [January 31, 2022, 4:46am UTC](https://community.fibery.io/t/branching-cases-in-automation-rules/2469 "2022-01-31T04:46:43Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![cannibalflea](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/cannibalflea/32/318_2.png) [@cannibalflea](https://community.fibery.io/u/cannibalflea)
#### Post date: [January 31, 2022, 4:46am UTC](https://community.fibery.io/t/branching-cases-in-automation-rules/2469/1 "2022-01-31T04:46:43Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Dimitri\_S](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/dimitri_s/32/1683_2.png) [@Dimitri\_S](https://community.fibery.io/u/Dimitri_S)
#### Post date: [January 31, 2022, 8:24pm UTC](https://community.fibery.io/t/branching-cases-in-automation-rules/2469/2 "2022-01-31T20:24:27Z")

</div>

Voted. 👍

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

> **[Conditional Logic for Airtable Automations | Airtable Blog](https://blog.airtable.com/conditional-logic-for-automations/)**
>
> Introducing a new way to support all of your most complex workflows: conditional logic.

---

<div class="post-metadata">

### Author: ![Sergey\_Truhtanov](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/sergey_truhtanov/32/13986_2.png) [@Sergey\_Truhtanov](https://community.fibery.io/u/Sergey_Truhtanov)
#### Post date: [February 1, 2022, 4:22pm UTC](https://community.fibery.io/t/branching-cases-in-automation-rules/2469/3 "2022-02-01T16:22:14Z")

</div>

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.
