Avoid empty objects with import mapping

0
Hey community,   I was curious if there is anyway to avoid these empty objects when using import mapping.    This json file:   {  "id": "ad107ecc-0bc4-4204-afc4-52fdd2a8683c",  "version": "2.0",  "name": "TEST",  "url": "https://www.google.com/",  "tests": [{    "id": "ec8186c5-91f6-417d-9409-d397d8dd1bed",    "name": "Mendix UI Test 1"}]}   Will produce this mapping:     How can I avoid the "Tests" object to be created as it is completely useless.   Thanks!
asked
3 answers
0

Hi Philipp, 

As a complement to my answer above, I have created a test microflow and it does work (see image below).

 

In the screenshot below, you can see in the debugger on the right that the Test object(s) exist (In my case they're not called Test but JsonObject). The JSON string variable in the beginning of the microflow contains the JSON you provided in your question and for the mapping I used the mapping I created in my previous answer (after which I clicked "map automatically" to create the DB entities automatically (see second screenshot).

 

microflow.png

 

Moreover, I have created the import mapping directly from the JSON you provided in your question as well.

 

mapping.png

 

Let me know if this helps.

 

answered
0

Just tried it with your JSON and the Import Mapping seems to allow it.

Could you try doing it like in the image below and see if it solves your question?

 

ExampleJSONImportMapping

answered
0

Delete the empty entity (Tests), and add an association between "Test" and "Root" (Test_Root), in the mapping of "Test you" can use the newly created association (Test_Root) as the "Association to parent"

answered