Creating Data-Driven Apps in Mendix 9.24: Exploring Alternatives for Initial File Import on Startup

Hello, I'm a beginner in Mendix, and I have a question about creating an app. I want the app to retrieve data from a file on my system every time it starts. I've heard about the Data Importer, but it seems to be available for Mendix 10.6, and I'm currently using Mendix 9.24. Is there an alternative method to achieve this goal? Thanks.
1 answers

Hi Muhmmad,


I believe you are looking for the FileDocumentFromFile java action. The one I use is within the JamCommons module, but the CommunityCommons has it as well. Though the JamCommons one is in my opinion easier to use since it automatically searches in the resources folder. 



To load a template XML you can create a microflow which first creates the entity the module uses for the document template which is mostly generalized from system.filedocument. Then use the java action specified above and specify the document name. That would look something like this: 


You can call this microflow in the afterstartup to make sure you always load the file into the database. In combination with the Excel importer module you can load data with the template on every startup. Load the data file the same as the xml template and call the correct microflow to import the contents.