Okay so now we need to built that into an array.
So first use a Merge Values step, and merge the new Flightmap column you made that contains the objects. Merge them using a comma as the delimiter, and do not add any grouping column to the second set of settings. This will group all of the objects into a single cell.
Let’s assume that new column where the merge took place is called Flightmap Merged
You can then use either an API Enrichment step or an API Export step to make the request.
In that request body, you will define all the other fields that you want, and you will merge in the Visits array innards like this:
{
"visits": [{Flightmap Merged}],
"fleets": [
{
"id": "78277",
"capacity": 10,
"start_location": {
"lat": 30.7188978,
"lng": 76.8102981,
"name": "CDCL, Madhya Marg, 28B, Sector 28B, Chandigarh, India"
},
"return_to_Start": false,
"end_location": {
"lat": 30.70549299999999,
"lng": 76.8012561,
"name": "Elante Mall, Purv Marg, Industrial Area Phase I, Chandigarh, India"
},
"shiftEnd": 2345
},
{
"id": "78278",
"capacity": 10,
"start_location": {
"lat": 30.7188978,
"lng": 76.8102981,
"name": "CDCL, Madhya Marg, 28B, Sector 28B, Chandigarh, India"
},
"return_to_Start": false,
"end_location": {
"lat": 30.70549299999999,
"lng": 76.8012561,
"name": "Elante Mall, Purv Marg, Industrial Area Phase I, Chandigarh, India"
},
"shiftEnd": 2345
}
]
}
And you can set the fleet information to be whatever you need it to be!
The main difference with your two step options are that the Enrichment will run in your builder as you use it. So changes made upstream will re-send those requests, and the response will be added to your dataset. Whereas the Export will only run when you publish and run the flow, and will not show you the response data (besides errors and things like that).