How to use import mapping with JSON array of Strings

0
Hello everyone I am implementing an integration , where I am using call REST service activity to make an call to the external server. The server returns below JSON as response. I have created message definition & generated import mapping based on that. The question which I have here is  Within the reponse , "aud"  fields has an array of Strings. Can anyone help in me in mapping this  array of Strings ? I have seen in case of array of objects, I can create objects & use retrieve based on association to get the data.      {  "data": {         "org": {             "name": "Org14feb2023",             "Number": "19984675",             "aud": [                 "NY",                 "RE"             ],             "telephoneNumber": "31850208566",             "email": "email" } } }
asked
1 answers
1

Hello G Dharani Kumar,

 

Instead of using a message definition I would advise you in this case to first create a JSON Structure: 

 

image.png

 

Copy paste your snippet in there click on format then click on refresh and then OK

 

Then create a import mapping based on this Structure/

 

image.png

Select JSON Structure and click select all and save:*

 

 

image.png

This will be the structure you need, to make life even easier select automatic mapping then mendix create the structure NP in your domain model;

image.png

 

Now you can make it again if you want as a message definition and you can map your full json.

*

Hope this helps

 

Good luck!

 

 

answered