databasemendix

How to insert initial data into Mendix Database?


I am just starting developing an app in Mendix. I have created the domain model, and now I need to import some initial data, but all I've managed to find in the documentation is how to insert it manually.

Is there a way to do this?


Solution

  • You can write a microflow to generate some initial data, and either a 'Scripts' page to run it manually, or have it run automatically on startup. In the latter case, you probably want to check for existing data first. Such a microflow could also (via custom Java logic) access the resources folder and import data files from there.

    There's also a feature App from a spreadsheet but you've probably already developed a part of the application already.