Help with Iterating Over API Response to Send Multiple Data in One Email

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:

  1. 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.
  1. 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.
  1. 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.
  1. 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.
  1. 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!

Welcome to the Make community!

To allow others to assist you with your scenario, please provide the following:

Relevant Screenshots

Please share screenshots of your scenario, any error messages, relevant module fields, and relevant filter settings. It would really help other community members to see what you’re looking at.

You can upload images here using the Upload icon in the text editor:

Scenario Blueprint

Please export the scenario blueprint file to allow others to view the mapped variables in the module fields. At the bottom of the scenario editor, you can click on the three dots to find the Export Blueprint menu item.

Output Bundles of Modules

Please provide the output bundles of the modules by running the scenario (or get from the scenario History tab), then click the white speech bubble on the top-right of each module and select “Download input/output bundles”.

A. Upload as Text File

Save each bundle contents in your text editor as a bundle.txt file, and upload it here into this discussion thread.

B. Insert as Formatted Code Block

If you are unable to upload files on this forum, alternatively you can paste the formatted bundles.
These are the two ways to format text so that it won’t be modified by the forum:

  • Method 1: Type code block manually

    Add three backticks ``` before and after the content/bundle, like this:

    ```
    content goes here
    ```

  • Method 2. Highlight and click the format button in the editor

Providing the input/output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

By providing these details, it will allow others to assist you better.