Learn how to store data locally and sync it to the Mendix server using offline commit. This step-by-step guide covers offline entities, commit behavior, nanoflow usage, and how Mendix syncs data once the user is back online.
What Is Offline Commit and Synchronization in Mendix Native?
In Mendix Native apps, when you create or update data while offline, the changes are first committed to the local offline database. This is called an offline commit. But this commit is temporary — the data is stored as unsynced changes, which means it’s not permanent yet.
To save this data permanently, the app must run Synchronization. During synchronization, the local unsynced changes are sent to the server, and the latest server data is downloaded back to the device. Only after sync does the data become stable and safe.
If you commit without synchronization, the data is not saved on the server, and also not kept locally when you close and reopen the app. That’s why offline apps always require Commit + Sync to prevent data loss.
Mendix gives you three sync modes, explained in very simple words:
1. All Objects
This option synchronizes everything.
All offline changes from your device are sent to the server.
All the latest server data is downloaded to your device.
Even file content (like images) is also synced.
Use this when: you want a full refresh of all data.
2. Unsynchronized Objects
This option syncs only the data that was changed offline.
All new or updated objects stored locally are sent to the server.
If any objects were deleted offline, that information is also sent.
Use this when: you want to sync only pending changes, not the whole database.
3. Selected Objects
This option syncs only the specific objects you choose.
You control exactly which entity or objects should sync.
Good for improving performance when you don’t need a full sync.
Use this when: you want partial sync for specific data only.
Go to MX Studio Pro Create a new module offlinecommit.
Create an entity with these attributes.

Right click on OfflineCommit Module -> Add Page -> Select Native Mobile Page & Give name the Employee_Overview -> Select Blank & in the layout NativePhone_Default(Atlas_Core).

Go to Employee_Overview Native Page -> Drag & Drop Listview.

Double click on ListView -> go to DataSource tab & select Employee entity from database.


Right click on OfflineCommit Module -> Add Page -> Select Native Mobile Page & Give the name Employee_NewEdit -> Select Blank & Inside layout select NativePhone_PopOver(Atlas_Core).

Go to the Employee_NewEdit page & take a dataview -> Double click on dataview & Select nanoflow as DataSource & create a new nanoflow DS_Employee.

Open DS_Employee nanoflow -> Take a create object activity -> select Employee entity & return the object.


Double click on Save button -> in the onClick select call a nanoflow & create a new nanoflow(ACT_Save).

1.Open ACT_Save nanoflow -> Take a commit object activity -> select Employee parameter & commit the object.

2.Now take a Synchronize activity, select Selected object(s) as the mode, and choose the Employee parameter inside the objects list.

3.Lastly, take a close page activity & select single.

Go to again Employee_Overview native page -> take a button and give the name Add Employee.

Double click on Add Employee button -> in the onClick events select show a page & select Employee_NewEdit native page.

Go to Navigation -> Native mobile (tablet & phone) -> Add New Item -> Employee & select Employee_Overview Native Page.

Now run the application and test it.


Now you can close and restart the app, and you’ll still see your previously added data — because it has been synchronized.
Conclusion:
I hope this article has helped you understand How to offline commit and Synchronize Data to the Database from a Native Page in Mendix.
Thanks for reading this! See you in the next blog post.
