Primary keys and foreign keys: UUID vs serial number
BeginnerChoose the right primary key strategy for your FileMaker tables — and understand why UUID (Get(UUID)) is safer than an auto-incrementing serial number.
What you'll learn
- The difference between a serial number and a UUID as a primary key
- How to set up a Get(UUID) auto-enter calculation for a primary key
- How foreign keys reference primary keys across tables
Every table needs a primary key that uniquely identifies each record, and the choice of key type has lasting consequences for data integrity in multi-user and multi-file environments.
1/3
1
Set up a UUID primary key with auto-enter
Create a text field named "id" (or "CustomerID", etc.). In Field Options > Auto-Enter, select "Calculated value" and enter Get(UUID). Uncheck "Do not replace existing value" so the calculation fires only on new records.
FileMaker Script
# Field: Customers::CustomerID # Type: Text # Auto-Enter: Calculated value # Calculation: Get ( UUID ) # [ ] Do not replace existing value of field (if any) ← leave UNCHECKED # so the UUID is set when the record is created # Result: each new Customers record gets a value like: # "7A4B2C91-3E5F-4A12-89DE-BC01234567FA"
Sign in to track your progress and pick up where you left off.
Sign in to FM Dojo