Hi, I have, what I think it probably a simple question, but I’m just not getting it currently, so hopefully someone can explain in simple terms what my failing is.
Scenario:
Part of an automation is responsible for gathering data store records relating to tasks that someone needs to perform. Currently I have a workaround to my issue in place by having three separate ‘Get a record’ modules, each designed to retrieve a specific record created elsewhere in the scenario. These records are then referenced individually in a later Gmail ‘Send an Email’ module as part of an email summary to a team. Works fine, but I’m guessing it is hugely inefficient as it is using three Data store modules (one for each record), where examples I’ve seen online seem to only use one somehow.
Problem:
If I utilise a single data store module to retrieve all records, then they are outputted as different bundles. This ultimately results in the Gmail module creating three separate emails, when I only need one.
Thought 1:
Do I use either an array or text aggregator to collate the bundles into one? If I do this I end up with only one referenceable output in the Gmail module, meaning I can’t put ‘Person 1 Jobs’ and ‘Person 2 Jobs’ in different parts of the email. Or am I missing something?
Thought 2:
Is the issue with the data store structure (as I don’t really understand that fully), and is there a combination of settings that will allow me to retrieve the Data store info as a single bundle, but still three separately referenceable outputs (or variables) for use in later modules?
Other examples found online haven’t helped, so I thought I’d ask the community. Many thanks in advance!
Hello! Welcome to the Make Community.
I recommend you to follow the Academy training when Aggregators are explained in details.
For your case, assuming that you have a field called “person”, you can use this field to split aggregated bundles by this key, the input is “Group by”.
For example, with a Text Aggregator
You can Search all Rows, then use the Text Aggregator with this GroupBy, you will have 3 bundles if there are 3 persons in the Data Store.
Then you can use an Email module with some logic to set the recipients email according to the “key” (person) you get.
Let me know if you are stuck somewhere
Benjamin
1 Like
Many thanks for taking the time to reply Benjamin. I will definitely look at the academy for more info on aggregators.
For this particular issue, I don’t think what you describe will quite achieve what I need, but excuse me if I’ve mis-understood. The final email that is generated will be going to all people using a fixed recipient list, so that isn’t a problem. The issue is that the email needs to contain all of the job allocations for everyone, so the whole team is aware. So in essence I need a single email at the end of scenario that will go to everyone.
I can piece this together by inserting the data from individual records, but I get the feeling that this isn’t efficient.
1 Like
Oh I think I understand now, sorry.
You just want to get all records, and put them all in one single email, right.
In that case you just need a Text Aggregator (you don’t use GroupBy); it will generate a single bundle with all data separated by what you want (could be New Line or could be
if you plan to send the email in HTML).
If every you are lost, I can show you an example
Benjamin
1 Like