You don’t ‘loop over’ data in FME.
Say your data is something like:
Name | Email | Type |
---|
Hamish | hamish@fme | a |
Adam | adam@fme | b |
Adam | adam@fme | a |
Hamish | hamish@fme | c |
Zipster | zipster@fme | b |
When passing this through the statistics calculator, make use of the Group By function
https://docs.safe.com/fme/html/FME-Form-Documentation/FME-Transformers/Group_Based_Transformers.htm
This will then mean it only compares features with the same value in the specified field(s)
If you used the ‘Name’ Field, your output would then be something like
Name | Email | count |
---|
Hamish | hamish@fme | 2 |
Adam | adam@fme | 2 |
Zipster | zipster@fme | 1 |
These can then be used be the report generator and emailer to create/send your emails
Thanks for the response, i have the unique list of emails that can be sent through to the emailer but what i need is for a second list of data to be filtered and provided in the email.
For example using your table above:
List A = Summary list of email addresses - Statistics calculator
Name | Email | count |
Hamish | hamish@fme | 2 |
Adam | adam@fme | 2 |
Zipster | zipster@fme | 1 |
List B = Individual records containing the email address attribute
Email | Ref | Location | Type |
hamish@fme | 20039 | Surrey | Type 1 |
adam@fme | 20040 | Hampshire | Type 2 |
zipster@fme | 20041 | Hampshire | Type 3 |
hamish@fme | 20042 | Kent | Type 1 |
hamish@fme | 20043 | Surrey | Type 1 |
adam@fme | 20044 | Kent | Type 1 |
zipster@fme | 20045 | Surrey | Type 2 |
I need the process to look at the email address in List A and then send an email to each address containing a table of data made of only records in list B relating to the specified email address.
Output table for 1st email would be to hamish@fme with the following HTML content:
Email | Ref | Location | Type |
hamish@fme | 20039 | Surrey | Type 1 |
hamish@fme | 20042 | Kent | Type 1 |
hamish@fme | 20043 | Surrey | Type 1 |
This would be repeated for each of the email addresses in List A until no more email addresses are available.
I have the HTML report created but need to understand the flow of how this would work.
Any help would be appreciated.
I think you need to do a join on the data. Probably join tables A and B using email address as the key.
Try the FeatureJoiner transformer first. It should create an output feature per match.
Alternatively, many people find the FeatureMerger to be simpler. You would create a list with that transformer and then use the ListExploder to create a feature per match.
With that, you should have a feature per email to be sent.