Table with static data

I need an table with static data for few process. How can i add the data to the table. Note: The data is static i.e it ill b one time load and should be retained in physical db memory.
2 answers

Depends on how large the table is. For a large table just create the table in Mendix and use the Excel importer to do a one time import of the data. If it just a small static table you could do all with microflows. Let the microflows create the data. I always create a microflow that checks first if the record of that table already exist otherwise I create it. We use this all the time for certain static tables.




For large data files you can also do that via a importing a JSON-string (or XML for that matter):
- Create a JSON_Structure with that same JSON-string.

- Create an Import_mapping using that JSON-structure, having find by key. See image.

- see this microflow. first CreateVariable type string and fill it with a JSON containing the all your static objects.

- add this to your startup.

Advantage of this method over importing an external xls or csv (which works fine by the way) is less overhead, no need for the Excel-importer and having your static data stored in the code.


Tip of a colleague to make it even nicer: create a constant to store your JSON-string. Makes it better maintainable.