How can I display (list view), export & import data that contains many-to-many associations?

0
Hi, I am building an application that filters and displays medical Information, that is commonly only available in large PDF documents. The user interaction should look something like this: - User selects topic and maybe a few other attributes for which they want to see information - The app displays the relevant results, including sources and other information - The User can look up further details for each result in a seperate page   The domain Model looks like this (it’s in german, sorry for that [the three entities on the left are topics and subtopics]):   My current problem arises from the fact that I need to have multiple many-to-many connections, due to the fact that for exaple one result can obviously refer to multiple sources and the vice versa. This however means, that Mendix won’t let me show information like what sources belong to a specific result in a list view (which is the stylistically optimal option for this app) and in some other places where I would need these informations, like in NewEdit pages:   As you can see in the Domail Model, I have tried to overcome this issue by using an entity in between the result and source entities. This however did not make a difference.   So my question is, if there is a way (maybe with a microflow?) to hand the relevant information over to the list view, so that I can display all the relevant information in it? Also, subsequently I would need the references to be available in the specific detail-pages for each result.     I should say that I have managed to display all relevant information in a data grid, which is helpful because I also need to export all the data for use somewhere else. The data grid however, does not give me enough freedom to get the interface looking the way I want it to. Another thing I have noticed is that, when importing the data again, the cells that contain references to multiple objects are imported as just one object. (example – the sources 73, 74 and 75, when imported again become one source “737475”):   So my second question would be, how I can import these many to many associations back into mendix from a spreadsheet?
asked
1 answers
1

Hi Luca,

To answer your first question: If i understand correctly in a list view of empfehlungs, you need to display possibly multiple Quelles per empfehlung. This can be done by putting a list view of sources inside the list view for Empfehlung. This looks somewhat like this:

 

The second question is more complicated. Excel is in the basis not very well equipped in handling many-to-may associations. There are several possible ways, and there are probably more than the ones that came to my mind.

 

For import:

- import one excel sheet per entity and, after initial import into mendix, loop thorugh the imported objects and create the associations for each object using a microflow.

- import one excel sheet containing comma separated values in one of the columns and, after import, create the new objects using a microflow.

- Using xml or json to import the data instead of excel

 

For export:

- create a data grid per entity and export separately

- use a calculated attribute that creates a comma separated list of values, use it in the data grid and export. (be cautious of possible performance impact)

- use the excel exporter marketplace module (please note: increased complexity)

- export to json or xml

 

I hope this provides some helpful starting points.

Michiel

answered