Conditional actions is an action that runs the actions inside it only when your conditions are met (the conditions decide whether the block runs, and the actions inside decide what happens). It's meant to help you handle different cases in a single automation, instead of building several automations that each start the same way.
You can use this action for many things, including:
Adding a comment for the finance team only when an expense is over the spending limit.
Assigning a task to a different teammate depending on the lead's region.
Note:
A trigger filter and conditional actions do different jobs. The filter decides whether the run starts at all. Conditional actions decide what happens inside a run that already started.
Actions below the block run in every case. Only the actions inside the block depend on the conditions. To stop everything for some records, use
End runinside the block.Nesting has a maximum depth. Blocks inside blocks work, but only up to a maximum depth. For deeper logic, move steps into another automation with
Call automation.
Who can use the Conditional actions action?
Automations are available on all plans: Free, Plus, and Premium. The number of automation actions per month depends on your plan. See the limits for your plan on our pricing page.
To add or change this action, you need to be a workspace admin of the workspace the database app is in. You also need full access to every database the automation uses.
Add the Conditional actions action
To run actions only when conditions are met:
Open the database app and click the automations icon in the top bar (tooltip
Create and view automations). The icon is only there for workspace admins, and not on mobile.Open an automation, or select
New automationand choose a trigger.Select
Add action→Conditional actions. In the list, it readsRun actions only if the conditions are met.Select
Add filterand set the condition.Select
Add actioninside the block and add the actions that should run when the conditions are met.Select
Create automationfor a new automation, orSave changesfor an existing one.
Conditional actions settings
The block has two parts. Its first line reads If the following conditions are met. Below it, the actions that run in that case are listed under Actions.
Add filter: adds one condition. Open the dropdown, select a field, then select how to compare it, for exampleContains, and enter aValue. The first condition readsWhere.Add filter group: adds a group of conditions. Use a group when you need to mix conditions, for example one condition and either of two others.AndorOr: filters and groups are joined withAndby default, so all filters must match. SelectAndin the second row and chooseOrif at least one filter must match. The choice applies to all filters and groups at that level.Add action: adds an action that runs when the conditions are met. You can add any action, including anotherConditional actionsblock.Else statement: adds a second branch that runs when the conditions are not met. Open the block's menu•••and selectElse statement. The branch is labeledElse if conditions are not met.
The conditions work like the filters on a trigger. You can compare field values and values of the trigger. To check a value from an earlier action, such as Perform calculation, use a script filter. Learn more about filters →
The block's menu ••• also has Settings, Continue on error, Deactivate, Turn into, Duplicate, and Remove. Learn more about action settings →
Name the block
Select the title Conditional actions and enter a name that says what the block checks, for example Over the limit?. You can rename the condition line If the following conditions are met and the else branch Else if conditions are not met the same way. Names help when you read a run's steps later.
Let's look at an example
Let's say your finance team wants every expense over $5,000 to get a comment, and smaller expenses to be approved right away. Here's how:
Set the trigger to
When a record is updatedand select the field that starts the approval, for exampleApproval.Select
Add action→Conditional actions.Select
Add filterand set the conditionAmount>5000.Select
Add actioninside the block and chooseAdd comment. Write "Over the $5,000 limit, please review and approve", and mention the approver.Open the block's menu
•••and selectElse statement.In the else branch, select
Add action→Update recordand setStatustoApproved.Select
Create automation.
The next time an expense is submitted, you should see only one of the two branches in the run's steps. Expenses over the limit get the comment, and all others are approved.
Handle several cases
To handle more than two cases, put another Conditional actions block into the Else statement branch. Each block checks one more condition, so you can build a chain such as "over $5,000, over $1,000, everything else". You don't need a separate automation for each case.
To end the run for some records, add End run inside the block. Learn more about End run →
Check more than fields
When a condition on a field isn't enough, calculate the check first. Add Perform calculation and write an expression that returns a value. A classic filter can't select this variable. Open the filter's menu •••, select Turn into script filter, and use the variable in the script.
For example, lead_field_email_email.endsWith('@acme.com') tells you whether a lead uses a company address. The editor suggests the exact variable names as you type. Learn more about Perform calculation →
Conditional actions errors
A block with no condition runs every time. If you add a block and don't set a condition, all actions inside run for every record.
If a condition doesn't match as you expect, check the values it compares. Learn more about filters that don't match →
If a run didn't do what you expected, open the run and check which branch ran. The steps show each branch that ran, with its status.
If you can't drop a block inside another one, you've reached the maximum nesting depth. Use
Call automationto move part of the steps into another automation. Learn more about Call automation →
Test, pause, or edit the Conditional actions action
Manual runruns the automation once. UnderRun on, select the records, then selectStart run, orSave and start runif you have unsaved changes. Filters apply, so only matching records lead to runs.A simulated run skips the trigger filter and doesn't change data, so you can see which branch a record takes. To test the trigger filter too, use
Manual run. Learn more about testing automations →To skip the block without removing it, select
Deactivatein its menu. A deactivated block is skipped completely, including all actions inside it.To change the conditions, open the automation, change the block, then select
Save changes.
Learn more
FAQs
Can I add an else branch?
Can I add an else branch?
Yes! Open the block's menu ••• and select Else statement. The branch runs when the conditions aren't met.
Can I put a conditional block inside another one?
Can I put a conditional block inside another one?
Yes. Add Conditional actions inside a block or inside its Else statement. There's a maximum nesting depth, so move deep logic into another automation with Call automation.
Can I check the text of a comment?
Can I check the text of a comment?
Yes. Use the trigger When a comment is added, add Conditional actions, and compare the comment text with Contains. Select Add filter and choose the comment's Body, then Contains.
Can I write the condition in JavaScript?
Can I write the condition in JavaScript?
Yes, for conditions that need more than a field comparison. Open the filter's menu ••• and select Turn into script filter. Write a JavaScript expression that returns true or false, and type @ to insert values. To switch back, select Turn into classic filter. You can also calculate the result first with Perform calculation.
Do actions after the block still run?
Do actions after the block still run?
Yes. Only the actions inside the block depend on the conditions. Actions below the block run for every record. To stop the run, add End run inside the block.
Are you a developer using the Tape API for automations?
Are you a developer using the Tape API for automations?
The automation API has its own documentation for developers. Full reference: conditional in the developer docs →
Still have questions? Find answers and get help from community experts in the Tape community →
