AutoBridge

Branching and Loops

Use IF/ELSE Conditions to send an automation down different paths depending on the record, and Repeating Group to run steps once for every record in a list. Evaluate Record Set answers "do all, any, or how many of these records match?" so a branch can act on the answer.


Prerequisites

  • An automation with a configured trigger.
  • For loops, a step that produces a list of records, usually Find Records.

Add IF / ELSE branches

1

Add the IF/ELSE Conditions step

Click + and choose IF/ELSE Conditions. Enter a Name such as "Route by permit type".

2

Choose what to evaluate

Set Condition source to Entity record to test a record's fields (then set Entity selection and Record Id, usually the trigger's Record ID), or to Prior node output to test the result of an earlier step and pick it in Prior node.

3

Build the first branch

Under Branch Conditions, the first branch is IF. Give it a label, then add its conditions and choose AND or OR for that branch. Every IF and ELSE IF branch needs at least one condition.

4

Add more branches

Click Add Branch for each ELSE IF path. Click Add ELSE Branch for a catch-all path that runs when no other branch matches. Only one ELSE branch is allowed.

5

Save and add steps to each branch

Click Save Changes. The canvas splits into one path per branch. Click + inside a path to add the steps for that branch. The paths join again after the IF/ELSE.

Branches are checked from top to bottom and only the first branch that matches runs. In run history, the branches that did not run, and their steps, show as Skipped.

When there is no ELSE branch

If no branch matches and there is no ELSE branch, none of the branch paths run. The panel shows this case as the None Branch ("When no condition is met"). Add an ELSE branch whenever "no match" needs its own steps, and check the result in run history while testing.


Repeat steps for each record

1

Find the records

Add a Find Records step with the conditions that pick the records, for example every Inspection linked to the permit.

2

Add a Repeating Group

Click + after it and choose Repeating Group. Enter a Name and optional Description.

3

Choose the list

In Input list, choose the records from the Find Records step. The canvas shows "Repeat for each in" with the list name.

4

Add the steps to repeat

Click Select Action inside the group and add the steps to run for each record. Inside these steps, use the current record from the group (for example, its Record ID in an Update Record).

Records are processed one at a time, in order. IF/ELSE Conditions and another Repeating Group cannot be placed inside a Repeating Group.


Check a list of records

Evaluate Record Set checks every record in a list found earlier and reports All match, Any match, and Match count to later steps.

SettingDescription
NameLabel for this step
Record setThe list from an earlier step, such as Find Records
Record predicateConditions each record is checked against
When the record set is emptyReturn false, Return true, or Fail the node

Follow it with IF/ELSE Conditions using Condition source Prior node output and pick the evaluation in Prior node to branch on the answer.


Example

Close a Building Permit only when every linked review is complete.

StepSettingValue
TriggerWhen record is updated, entity Plan ReviewWatching Fields: Review Status
Find RecordsEntity Plan ReviewPermit is any of the trigger's Permit field
Evaluate Record SetRecord setthe Find Records result
Record predicateReview Status is Complete
When the record set is emptyReturn false
IF/ELSE ConditionsCondition sourcePrior node output, the evaluation step
IF branchAll match is true
IF path: Update RecordRecord Idthe trigger's Permit field
Field: StatusStatic: Ready to Issue

Common mistakes

  • Leaving a branch without conditions. Every IF and ELSE IF branch needs at least one.
  • Expecting more than one branch to run. Only the first matching branch runs; order the branches from most specific to least specific.
  • Looping over a large Find Records result when a single Update Record or a condition would do.
  • Forgetting When the record set is empty. Decide whether "no records" should count as a match.

Related guides