Implementing auto import of Excel file using Excel Importer in the Mendix cloud

With our continuous integration/deployment process it is necessary to deploy metadata using the Excel importer. I would like to be able to deploy the necessary files in the deployment package and then run a webservivce that would grab the templates and data from the deployment and then import the data. Is there a way that would allow the metadata files and templates to be packaged in the deployment? Or is there another way that I can incorporate the data imports into the CI/CD process?
1 answers

Hi Jason, 

You can add these files in the resources folder of the project. Then in a microflow you can use the community commons java action "GetFileContentsFromResource" to retrieve these files and execute all of the necessary logic after that. 

So if I understood you correctly, you would want to add excel files and excel importer templates to the resource folder, and then in a microflow automatically import everything so you dont have to do it manually?

You could do this in your after start up microflow or have a microflow button in a dev page somewhere that you could press ( I recommend option 2). You would have to retrieve all of the files from the resource folder, run the model reflection microflow, import the excel templates, retrieve the excel templates, associate the correct documents to the excel templates, and then use the excel importer java action to import the excel files.


 Your microflow would probably look something like this.


I haven't tested this out but I'm fairly positive that this can be accomplished. Let me know if you have any questions and hope this helps!