How to get all emails segregated by label

I’m currently able to pull all emails using gmail module that have been received in the past 24h, however I’d like to have them separated by label.

Currently, gmail module returns messages in an array of bundles - 1 email per bundle

Ideally, I’d like to convert that output into an array of arrays of bundles, where first element of the main array will contain an array with all emails (bundles) with label A, second element will contain an array with all emails (bundles) with label B etc.
By “label” I refer to label/tag that an email has assigned in gmail.

Alternatively, any other solution that would let me have all emails segregated by label that I can do further processing on (but I’d like to have them all downloaded at once and ready in an array)

Is that possible in make?

2 Likes

Hi @Onte

Please use “group by” inside array aggregator and use label field to group records.

Regards,
Msquare Automation - Platinum Partner of Make
@Msquare_Automation

3 Likes