🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
Import Data
This page was created by Alexandra on 2017-05-19. Last edited by Wikiadmin on 2026-09-12.


This is old content that has been superseded by this article: Documentation:Convergence_–_ViewModels,_import,_export,_multi_search,_synchronization_and_Excel

This article describes a new feature of the EcoSpaceDebugger. The feature lets you easily import any tab-separated data into any eco-based system and enables you to define transformation on how to interpret the data and also look up values in to set links.

Suppose you find some data somewhere:

And you have a model that should hold it:

You can create a ViewModel that explains how to receive the data:

Now click up the system prototyper:

Start the system and click on the debugger:

Switch to the “Import tab separated” tab, enter the ViewModel you want to control the import, and press “Get headers from viewModel” to the names in columns – in this case, Code and Name:

Paste in your tab separated data and press GO:

Now you have created objects – switch to the “Dirty Objects” to save them…

The “UseKey” Flag[edit source]

The UseKey instructs the logic to pick the first column. Try to look up this value with <ClassFromViewModel>.allinstances->select(keyname=’valueinfirstcolumn’). If an object is returned, it will be used for an update – if none is returned, a new one will be created. This will give one such evaluation per imported row.

I have found this to be a very versatile tool. One thing, though, that limited the usefulness of the tool is how keys(first column) are looked up in existing data. Before, all you had was “UseKey” and then “Key” which should be an attribute in the model. Here we have extended the ability to enter your own criteria:

This way I can, for example, have an optionalfilter like this “->select(lp|(lp.ArticlePricePeriod.Name=’2014′) and (lp.SalesArticle.Article.ArticleNumber=vKeyValue))” and the imported values are steered to update just the objects I had in mind.

Setting Links[edit source]

Often, you will want to assign a link when importing your data. This is done by designing a ViewModel that has PickLists. This is powerful since the lookup will be made on the result of the expression of the Associated ViewModel Class. The lookup will be done in memory in dictionaries and will be very fast.

Creating Link Objects[edit source]

Link objects can be created the same way. You will need to provide the two keys needed for the association in the first 2 columns.