How To Email Related Records in Tabular Format from Flow

Salesforce Email Related Records in Tabular Format

Acknowledgement: The full credit for this blog post goes to Amruta Udgiri, one of our course participants, for sharing her idea on how to email related records in tabular format from Flow.

One of the common requirements in a Salesforce implementation is to email a list of related records like cases, invoices, payment statuses etc. to customers in a nicely formatted email.

With Classic Email Template, we used Visualforce to meet such requirements. In Flow there is a native “Send Email” Action.

In this guide we are going to look at how to use the send email action with a couple of other Flow features to retrieve the list of records based on certain filter condition, format the list nicely in a HTML table and email it to the one of the selected contacts. All this in just under 30 minutes. But let’s first take a look at the end result of what we will be building.

And here is the step by step guide to build what we just saw. Let’s dive in.

Introducing Mastering Salesforce Flows Training Course

Liked this guide? We are now offering a complete self-paced, video-based training course on Mastering Salesforce Flows. The course comes with downloadable step-by-step PDF guides, unlimited access, free upgrades, area to ask questions, free preview & 100% money back guarantee. For more details, please click here.

Need Help with Flows?

Need advice on Flows? I also offer advisory & consulting services on Salesforce Flows. So, whether you want to create new Flows or migrate existing automations (Workflow Rules, Process Builder, Triggers) to Flows, I can help you analyze, design, plan & review. To initiate a discussion, please submit the contact form here stating your requirement or book a 30-minute free discovery call at this URL.

References & Useful URLs

14 thoughts on “How To Email Related Records in Tabular Format from Flow”

  1. I’m trying to build this on the Opportunity object. I would like to Get the Opportunity record before the Account record. I’ve added it in but when I start the flow on the Opportunity no Contacts are populating.

    1. Hi Janelle, if you are starting the Flow on Opportunity record, you must be passing the Opportunity Record ID to the flow. From opportunity you need to get the Account Record ID and then get the contacts based on the Account record ID. This could be the issue.

  2. Hi Ashish

    As usual, love it thanks! Can’t wait to try it out!

    Is there a possible final step to record the email sent as an email message for visibility?

    Cheers
    Nic

    1. Thanks Nic. Glad that you liked it. Currently, there isn’t an out-of-the functionality to record the email. But what I have done in my org is explicitly create a ‘Task’ record for the contact and store the email subject and body in the task record. Prefix the task subject with ‘Sent Email: ‘. See if this will work for you.

  3. Ashish,
    This new button is fantastic and works great for me (System Administrator).
    But when I log in as one of my users, I do not see the new button. I have even stood beside a user when he was in Lightning – no new button.
    Any suggestions?
    Please let me know if you’d prefer me to submit a case with Salesforce. I’ll understand.
    Many thanks.

    1. Hi Larry, here are the things you can check.

      1. Is the button added using Dynamic Action? Is there any filter condition attached to the button?
      2. Does the user have ‘Run Flow’ system permission?

  4. Ashish,
    As a temporary solution for adding BCC: sending user, I created the following formula which includes both the selected contact AND sending user as To recipients.

    {!SelectContact.firstSelectedRow.Email} + ‘,’ + {!$User.Email}
    For my purposes, this is a viable option. I am really loving this FLOW and will definitely build upon it with other uses.
    Thanks again.

  5. YES – Deliverability. I remembered that and wanted to let you know that was my problem.

    Is there any way to include a BCC: to the sender
    OR
    Create an Activity History of the sent email

    1. Hi Larry,

      1. Currently there isn’t an option to send BCC from ‘Send Email’ action in Flow. However, under set up, there is an option ” Compliance BCC Email “, which will send a bcc to all the emails sent from Salesforce.
      2. Emails sent from Flow will not create an activity history record. But you can explicitly “create” a task record in the Flow to create the activity history. I do this in a couple of my Flows. 🙂

      Regards,
      Ashish

  6. I love the step-by-step tutorial. However, up through page 21 I’m good.
    Page 22 I’m derailed! I do not see the Component Input (1) – Data Table in order to drag it to the canvas.

    Did I miss something along the way?

      1. Thanks Ashish.
        The sandbox I was using on Oct. 14 was just upgraded to Winter ’23 on Oct. 15th.
        I have the Data Table now, completed creating the FLOW and did my first test.
        Even though I got the Confirmation screen, I have not received the actual email.
        I’m reviewing everything from the beginning.
        Thanks again.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top

Don't Miss Out on New Step-by-Step How To Guides on Salesforce...

…Subscribe to Our Newsletter!