Hello, I am having trouble with iterating over the data I get from an API and sending multiple pieces of information in one email using Make (formerly Integromat).
Here’s a detailed explanation of the problem:
- What I am trying to achieve:
- I am using the HTTP module to fetch data from an API. The API returns a list of ships arriving and leaving a port today (with details like name, origin, arrival time, departure time, flag).
- My goal is to send a single email that lists all ships arriving and departing today in a table format.
- The current flow:
- I use the HTTP module to get the data from the API.
- Then, I use the Array Aggregator to aggregate the data into a single array.
- Finally, I use the Gmail module to send an email, using the data from the aggregated array.
- The issue:
- Even though the API returns multiple ships in the Data[] array, the email only contains data for the first ship.
- I have tried to use the
{{Array[0].nombre}}
,{{Array[1].nombre}}
, etc., but the data for all ships is not showing up correctly. It seems like I’m only getting the first ship’s data in the email. - The API returns a list of ships (multiple items), but I am only able to display the first one.
- What I’ve tried so far:
- I have tried using the Array Aggregator to aggregate the entire list of ships and then access each ship’s data individually, but it still only sends the first entry.
- I have also ensured that the Parse response option is set to “Yes” in the HTTP module, and I am passing the array correctly to the next modules.
- What I need help with:
- How can I correctly iterate over the array returned by the API to display all the ships in a single email?
- Is there a better way to handle this array in Make, or any tips to make the iteration work properly?
Any help or guidance would be greatly appreciated!