The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Flow designer to send bulk email with unique approver in 'TO'.

gagan12
Tera Contributor

I have created a flow, which is scheduled weekly. Then I look up records on the 'sysapproval' table with some condition. I am using 'for each' for getting all records and storing them. Later in the flow, I am using 'Send Notification.' OR 'Fire Event'. I have created a flow variable for storing sysId/emailID of approvers and using that in the event parameter. for 'Send Notification' I have added recipients in Notification (users in field).

If my lookup returns 4 approval records, and on 2 of them the approver is 'TEST USER 1' and on the other 2 it is 'TEST USER 2.' I want one email to get triggered with recipients as Test User 1 and Test User 2. Currently, for all four records, I am getting 4 separate emails.

Basically, I want all approvers of returned records in a single email (to) and if the approvers are the same on 'N' records, he/she should receive only one email (no dupicate emailid should be there).

1 REPLY 1

pavani_paluri
Giga Guru

Hi @gagan12 ,

 

Trigger: Scheduled weekly

Lookup Records: sysapproval with your condition

Initialize Array can be a Flow variable : approversList

For Each (approval in Lookup): Add approval.approver to approversList

New Script action : Deduplicate → uniqueApprovers

Send Notification: Recipients = uniqueApprovers

 

Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Pavani P