Creating an array in json

0
Hi, I need to build the following input for a REST call: { "Metrics":["Speed1","Counter1","Stato","Cycletime1"], "ItemsNumber":4, "From": "2018-04-26T09:33:29.8291411+02:00", "To": "0001-01-01T00:00:00.0000000+01:00", "QueryInfo":null } How can I build the Metrics array in this object? I used the JSON export mapping tool and here is the result: It seems like each of the string objects in my array got turned into the Wrapper object. I cannot set this. I am thinking that I could build this manually or with a java action but I was wondering whether there is a standard way of handling this.   Thank you, Sebastien
asked
1 answers
2

Hi Sebastien

When you are sending the mapping to the input of a web service, you will make use of an Export Mapping.  Make sure in this mapping you select the Value attribute from the Wrapper:

Then you will see it when you try to connect entities to it:

And you can use the “Map automatically...” button again to create the new attribute in the Domain Model.

 

Once you are past this, you will create the Mendix objects that will form the array in a Microflow that could look something like this: Model Share

answered