Real-Time Sync Patterns Between FileMaker and External Systems
ExpertDesign and implement bidirectional real-time synchronization between FileMaker and external databases, including conflict resolution and sync state tracking.
What you'll learn
- How to track changes in FileMaker with a modification timestamp and sync flag
- How to implement last-write-wins conflict resolution
- How to handle offline periods with a sync queue
- How to detect and repair sync drift
Bidirectional sync is one of the hardest integration problems: both systems can change the same record, changes may arrive out of order, and connectivity is intermittent. FileMaker's lack of native change data capture means you need to build your own tracking layer. This lesson covers the core patterns that make sync reliable.
Change tracking with modification timestamp and dirty flag
Add ModifiedTimestamp (auto-enter modification timestamp) and SyncDirty (number, 1 = needs sync) to each table. OnRecordCommit scripts set SyncDirty = 1. The sync engine queries dirty records and clears the flag after successful sync.
// FM field auto-enter: ModifiedTimestamp
// Calculation: Get ( CurrentTimestamp ) (replace existing value)
// FM Script: MarkDirty (called by OnRecordCommit)
Set Field [ Contacts::SyncDirty ; 1 ]
Set Field [ Contacts::SyncVersion ; Contacts::SyncVersion + 1 ]
Commit Records/Requests [ With dialog: Off ; Skip data entry validation: Yes ]
// Sync engine find: records modified since last sync
POST /fmi/data/v1/databases/CRM/layouts/Contacts/_find
{
"query": [{ "SyncDirty": "1" }],
"sort": [{ "fieldName": "ModifiedTimestamp", "sortOrder": "ascend" }]
}Sign in to track your progress and pick up where you left off.
Sign in to FM Dojo