Hey all,
I am new to Make and am trying to set up a system where every morning, the Get Email function looks for all emails sent to an address during the last 24 hours, sends each of them to ChatGPT to summarize, and then produces one document with all of the summaries in it. Right now that’s going to a google doc, but a single email would also work.
I am able to do this right now using a very simple scenario that I just schedule to run at 9:15 in the morning. I have attached the scenario as an image.
However, what I would like to do is run a couple of steps only one time after it finishes processing all the emails, summarizing them, and copying them into the Google Doc. Namely, I would like to change all the links in the Google Doc to be hyperlinks (which the Google Docs module can do) and then send an email notice that the digest of summaries is ready to read. I cannot figure out how to get it to run those only after it has processed all of the emails. There does not seem to be any way to signal that the email module has finished grabbing all the emails it is going to grab, since it’s a variable number depending on the day. Some days, I receive 10 emails, some days 15, some 4.
I have played around with arrays and attempting to count bundles and stuff, but i cannot figure out a way to make it finish all of the iterations of the initial “loop” (if that’s the right word) before it goes on to further steps. I feel like I am missing something very simple. Any advice would be greatly appreciated!
Thanks!
Welcome to the Make community!
Aggregators
Every result (item/record) from a list/search/match module will output a bundle. This can result in multiple bundles, which then trigger multiple operations in future modules (one operation per bundle). To “combine” multiple bundles into a single variable, you’ll need to use an aggregator of some sort.
Aggregators are modules that accumulate multiple bundles into one single bundle. An example of a commonly-used aggregator module is the Array aggregator module. The next popular aggregator is the Text Aggregator which is very flexible and can apply to many use-cases like building of JSON, CSV, HTML.
There are other types of aggregator modules, click the below links to find out more:
Array Aggregator – mapping multiple bundles into a complex field
The Array Aggregator module is very powerful because it allows you to build a complex array of collections for a later module’s field to map multiple items (collections) to it.
This is done using the “Target structure type” of an Array Aggregator module.
Here is an example:
As you can see, the “Map” toggle on complex fields are used when you have an array. You can easily build an array variable to map to a future module’s field, by using an Array Aggregator module and select the “Target Structure Type” as the future module’s field you have mapped the array into.
Hope this helps! Let me know if there are any further questions or issues.
— @samliew
Here are some useful links and guides you can use to learn more on how to use the Make platform, apps, and app modules. I found these useful when I was learning Make, and hope they might benefit you too —
Getting Started
Help Centre Basics
Articles & Videos
Hope this helps! Let me know if there are any further questions or issues.
— @samliew
P.S.: Did you know, the concepts of about 70% of questions asked on this forum are already covered in the Make Academy. Investing some effort into it will save you lots of time and frustration using Make later!
I had tried adding the Array Aggregator before the Google Doc before, but it did not seem to make a difference in how the scenario played out. Maybe the problem is that the Google Docs module does not have a Map toggle for the text that is being appended? I cannot figure out a way to get the array that the Array Aggregator creates to go into the Google Doc. This is the options it gives me. Any advice?
Try using a text aggregator instead, since you are dealing with text.