If vs Case in FileMaker calculations

Beginner

Understand when to use the If function and when to use Case. Case is almost always clearer — here's why, and when If still makes sense.

What you'll learn

  • How If and Case differ in syntax and behavior
  • Why Case is preferable for more than one condition
  • When If is the correct choice

Both If and Case can handle conditional logic in FileMaker calculations, but they are not interchangeable. Case scales cleanly to many conditions; If is best for simple true/false expressions. Knowing when to use each makes calculations easier to read and maintain.

1/4
1

The If function: true/false, one condition

If ( test ; resultIfTrue ; resultIfFalse ) evaluates a single test and returns one of two values. It is clean for simple binary logic.

FileMaker Script
// Is this invoice overdue?
If ( Invoices::dueDate < Get(CurrentDate) ; "Overdue" ; "Current" )

Sign in to track your progress and pick up where you left off.

Sign in to FM Dojo