Map each iteration of an array

I have an Airtable Base with a document upload field. I take the URL of the documents and map that to a JSON to pass through an API.

Sometimes users will upload multiple documents to that table. The output URLs are in an array. I have a pdf module which will combine the PDF files into a single URL, I just need to map all the URLs in the array to the module.

However, I am having a very tough time doing this. From the Airtable module I can only map the first URL in the array. If I use an iterator, I cannot map each iteration in the same module. If I put the pdf module after an aggregator, I can again only map one iteration, and cannot set a variable of both iterations in between the iterator and the aggregator. I tried setting a variable but run into the same issue where I can’t map more than one iteration.

I solved this issue in another scenario with email attachments by creating a Drive folder, uploading everything to that drive folder, and sharing a link to the folder.

I can’t do that here, as I don’t know how many docs are uploaded, and I’d have to map a different path for each number of documents in the folder with LEN().

Does anyone know how I can solve the problem of mapping multiple URLs in the upload file field to a JSON? Chat GPT suggested creating a loop and performing the action in each iteration in the loop, but I don’t know how to do that…


Welcome to the Make community!

The Input Link field accepts comma-separated values, so all you need to do is to join the array of URLs with a comma, something like this:

{{ join(map(19.array; url); ",") }}

If you need further assistance,

Please provide the output bundles of the modules by running the scenario, then click the white speech bubble on the top-right of each module, save the bundle contents in your text editor as a bundle.txt file, and upload it here into this discussion thread.
Screenshot_2023-10-06_141025

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

This will allow others to better assist you. Thanks!

2 Likes