Programmatic data entry to Mendix database?

0
Hello!   I am working with Mendix and wondering if there is a quick way for users to use an API to put data directly into the Mendix database? Eg put the data into the database via a command, rather than opening the application and doing it there?
asked
3 answers
1

Hi Hartley Robinson

 

If the data is not required to be fetched with each session, then you can add a scheduler event which will run in background and fetch the data from REST and store it in your database. You can decide on the frequency of the scheduler.

 

Thanks

answered
0

if you want the API data directly to be loaded in Mendix DB before start of the app.

Write one microflow to call REST API and get the data and store it in DB and invoke this microflow in AfterStartup section.

 

So this microflow will be called everytime the server starts and the data will be loaded automatically from the API.

answered
0

By the sounds of it, you want external apps/users to put data in to your mendix database?

 

Assuming the app is always running you can create a published REST service that will accept a JSON payload, this can then be mapped to your domain model, create the object(s) and commit it. 

 

Now you will have an endpoint that any external app or user can post data to, to store it in the Mendix app. You must be very conscious of security when doing this for obvious reasons.

 

https://docs.mendix.com/refguide/publish-a-rest-service/

This tutorial is for sending data out, but is a good starting point and gives you the foundations to change it to accept and store data rather than returning data

 

 

 

 

 

answered