Flow Loops Just Got Simpler

Actually, I don’t know when this change happened, but I just noticed that Flow loops now only have four steps instead of five. The two assignments can now be consolidated into one.

You still have to add the record to a collection, but you can use the same assignment element.

Example 1: Update the record currently in the loop.

  1. Use a Get Records element to create a collection of records to loop through.
  2. Add a loop element
  3. Add ONE assignment element
    • Update field values for record currently in the loop.
    • Create a new record collection variable to hold the records you want to update.
    • Use the same assignment element to add the record currently in the loop to the new collection.
  4. Add an Update Records element to update the records in your new collection.

Follow my blog to keep up to date on Flow and Salesforce


Example 2: Create new records.

  1. Use a Get Records element to create a collection of records to loop through.
  2. Add a loop element
  3. Add ONE assignment element
    • Create a new record variable (not collection) to hold the values of the new record you want to create.
    • Assign field values to your new record variable.
    • Create a new record collection variable to hold your records that you want to create.
    • Use the same assignment element to add the record currently in the loop to the new collection.
    • Close the loop.
  4. Add a Create Records element to create the records in your new collection.

Previously step 3 involved two assignment elements!

Watch this recording on Flow loops.

This is how you would combine steps 3 and 4 into one assignment!

How to Use the Migrate to Flow Tool and Recreate Your Workflow Tasks

The Migrate to Flow tool can quickly move your Workflows to Flows, but it can’t recreate your tasks. I’m here to teach you how to do that.

In this how-to-video, you can learn along with the Salesforce Nonprofit User group in San Francisco, how to:

  • Use the Migrate to Flow Tool

My section of the video is the first 30 minutes. Thanks to the user group for having me!

Learn more about migrating to flow on the Salesforce Admin’s blog.

Log Email Sent Through Flow on a Contact Record

Shows the activity timeline of a contact record with one email message stored there sent at 2:46pm today with subject "Welcome to the family, Jemma!"
Log an email message on the contact record like this one.

When sending email from a contact record, it magically logs the message to your activity log. In classic, emails were/are automatically logged to the Activities related list. Well, flow doesn’t do that for you. Let me show you how to log it so you and your colleagues know when an email was sent to a contact.

After you add a “Send Email” action to your flow, add two more Create Records elements to the canvas. You will create records of these objects:

Continue reading Log Email Sent Through Flow on a Contact Record

Live Session 7/26 on Flow Error Handling

Join MVP Aleks Radovanovic (Okta) at Salesforce Labs Day on July 26, 8am PT as she discusses my* Salesforce Labs solution for Flow Error Handling.

Session Description: With Flow becoming the dominant declarative automation tool, business problems we are solving with automation are becoming more complex. We need to be able to build scalable Flows that are easy to maintain, upgrade and troubleshoot, but handling errors in Flows is not always intuitive and user friendly process. Flow Error Handling solution from Salesforce Labs helps Admins to discover Flow errors in faster and more straightforward way. In this session we will show how Admins can use this Salesforce Labs Flow solution to pinpoint exactly where the process went wrong and obtain crucial details of the recorded incident that will help with troubleshooting and fixing the problem in a timely manner.

Get the app from AppExchange here.

Register for Salesforce Labs Day here.

*Thomas George taught me how to handle flow errors this way when we worked together at Optimum Energy. I love that I got to share it with others through Salesforce Labs.

10 Steps to Get Started with Salesforce Flow

Here’s my ordered list to help you get started learning Flow. It includes short and long videos, Trailhead modules and projects, hands-on training and “your turn” challenges to help you stretch what you’ve learned.

Starred items I had a role in creating.

1. Watch 4 Short Videos*

Get a very basic understanding of flow and some of the more difficult to grasp concepts. (Watch the first 4 and come back to the loops video later).

2. Complete the trail Build Flows with Flow Builder

This gets you started in Flow Builder and applies concepts you learned in the videos.

Continue reading 10 Steps to Get Started with Salesforce Flow

Flow: Display Photo or Upload Photo

The flow will display either a photo or remind you to upload one. On any object!

How It Works:

The Flow looks for a file attached to that record with the title “SalesforcePhoto” (or another phrase of your choosing).

The File gets the title from the name of the file when you upload it. If you upload SalesforcePhoto.jpg, the title becomes “SalesforcePhoto.” You could also open the File details in Salesforce and change the title.

If that file is found, it’s previewed thanks to the work of Narender Singh, (of course)!

If not found, it asks you to upload a file from your computer named SalesforcePhoto and attaches it to that record. From then on the, the flow displays the photo!

We are using the app because constituents and donors are more than just a record, and seeing their faces humanizes the data.

Donna, Vote Solar
Continue reading Flow: Display Photo or Upload Photo

Invocable Methods: How to Send Data Between Flow and Apex

Invocable methods used with Flow allow you to launch something in an admin friendly format that uses the massive power of Apex. For example, you have an intake screen that collects answers to a few questions, then you use Apex to loop through many related records dispersing those answers in places hard to reach from Flow.

Creating an invocable method in a nutshell: First you write an apex class with @invocable method (label and description) and whatever code you want the apex to do (easy, right?) Then make your Flow including your input and output variables. Then add an Apex action in Flow to send/receive those variables.

Here are some things I learned about sending data between Flow and Apex.

Invocable methods in Apex always receive a List and they return a List unless the return type is null. Read more under “Inputs and Outputs” here.

SentSent FromReceived by Received
Record Variable.idFlowApexList<Id> listOfIds
Record Collection VariableFlowApexList<List<Opportunity>> nameOfThis
List containing 1 sObject recordApexFlowRecord (single) variable
List of Lists of sObjectApexFlowRecord Collection Variable

This is NOT an exhaustive list at all. I didn’t try sending a record variable (not just the ID from Flow), but I assume that will work. There are also generic sObjects that are pretty special, but I didn’t try.

Continue reading Invocable Methods: How to Send Data Between Flow and Apex

Send Tables in Email in Flow – NPSP Example #2 Memorial Gifts

This is the second in a series on sending email with an embedded table of records of NPSP objects. The first post was a list of payments.

“Here is the use case: sending a family of a deceased relative one letter with all the names of people who have donated in memoriam. So, one letter to the family for many people who gave. Client is a large hospice so this is happening weekly. Open to different options — apps? exports & merge? other? Thanks!”

Rob asked in the Power of Us Hub, back in April

Well, I’m a few months late, but here you go, Rob. I made a Flow that sends out an email like the one below. I see now that you said “letter”…oops. Hopefully you figured out a solution by now, anyway!

Install this unmanaged package to try it out.

Continue reading Send Tables in Email in Flow – NPSP Example #2 Memorial Gifts

Use Summer ’21 Flow Collection Sort to Label Top Ten Donors

Broad use case: Use the new Collection Sort feature in Flow to find a specific number of records that meet your criteria, and sort them with one or more criteria (criterion?)

Example use cases: I want my top 3 open opps to have a giant dollar sign image on them or I want to automatically nudge/shame the five users who logged in least last month or I want to focus a campaign on my most active volunteers in the summer.

Our specific case: I want to look at a contact record in Nonprofit Success Pack and see immediately that they are one of my top ten donors.

Install this unmanaged package to try it out.

Continue reading Use Summer ’21 Flow Collection Sort to Label Top Ten Donors