Winter ’20 Flow Preview!
I’m pleased to report on the great things the Flow team has built over the Summer. These Flow Previews have become my favorite blogs to write because there are so many goodies to disclose. If you want to try these out immediately, get a free preview org.
It’s now possible to schedule Flows to run on a schedule. This applies to “Autolaunched” flows (i.e. flows without screens). Double-click on the Start element to set the schedule:
Notice that you can also add a record query. At the scheduled time, Flow will run the query and then run the Flow for each returned record, providing a powerful new batch mode capability.
Conditional Field Visibility
Fields can now appear and disappear on the screen as a result of some other field or value.
This is controlled via this new section in the field property editors:
Operator Note: If you’ve just created a field, you have to close the screen and reopen it before that field can be used as a ‘parent’ field. Yes, we think this is annoying too and we’ll fix it next version (this is one of those ‘harder than it looks’ caching yadda state storage yadda yadda problems).
Automatic Output Handling
The Automation group at Salesforce is in the early stages of a multi-release campaign to simplify the process of creating Flows. This will touch nearly every part of the product. One of the first benefits harvested from this can be seen in a change to the Get Records element. As you’ll recall, when you query for a record or a collection of records, Flow requires you to define a variable of the same type to temporarily store the information. That is done here:
You then use the storage variable when you refer to the queried records in a downstream element, like this:
In Winter ’20, you no longer have to do this. The streamlined Get Records looks like this:
Automatically generated references for Get Records queries look like this:
and automatically generated references for Screen Components look like this:
- To access the ‘old way’ of doing things, click the new Manually assign variables checkbox at the bottom of the property editor.
- Existing flows are not converted. For them, the “Manual” checkbox is checked and your existing variables and mappings remain unchanged.
- You can convert an existing Flow to use automatic output handling by unchecking the “Manual” checkbox, but we’ll put a big warning message up, because you’ll have to fixup any downstream references that use your old variables.
- In Winter ’20, we implemented support for this in two places: Get Records (as shown above) and Flow Screen Components. We’re working on extending this support to the remaining parts of Flow Builder that currently require manual variables.
- In a future release, we’re going to continue to improve on this by eliminating the entire “Select Account Fields to Store in Variable” section as well.
Flow Screen Components Built with Lightning Web Components
Lightning Web Components is Salesforce’s new framework for creating fast, reusable components. Flow already has a growing set of custom screen components built using the previous Aura technology, and those will continue to work. We’re advocating that all new development of components be done in the new Lightning Web Component technology, though, and you’re going to start to see new functionality that is only available to Lightning Web Components and not to ones built in Aura.
We’ve published a blog post here that consolidates all of the important information about creating and using LWC-based Flow Screen Components.
Lookup Screen Component
It’s now easy to add a Lookup field to flow screens:
This component includes type-ahead search, and a list of recently chosen records. Here are the input parameters that you can pass in to it:
You configure it by pointing it at an existing Lookup field using the Object API Name and Field API Name fields. If you want to set its initial value, you can pass in a recordId, and you can make the field required.
Canvas Usability Enhancements
Enhancements to the canvas include:
- Changes to Panning Behavior – Panning is now done by simply clicking and dragging the canvas around. You no longer need to enter a “Panning Mode”.
- We’ve added the ability to drag-select multiple elements. Toggling the Drag-Select button switches from panning to selection mode. See below for an example:
- Finally, you’ll notice in the above image, that each element has up to 2 lines of space for its name text.
Per-Profile Flow Permissions
You can optionally secure flow definitions on a per-profile basis.
New Flow List Page
We’ve refreshed the main list view in Setup.
Process Builder Enhancements
We made a couple of enhancements to Process Builder:
- Process Builder can now trigger on Account Team Member changes. (Account Teams must be enabled in your org)
- Some Process Builder actions can now use platform event payload data as inputs.
- Use Process Builder with the new FlowExecutionErrorEvent platform event to generate custom notification schemes when Flow errors occur (see below).
Custom Error Message Notification Schemes
When an error occurs in Flow, a platform event called FlowExecutionErrorEvent is now fired, and you can subscribe to that event with a Process Builder trigger. This lets you use the power of Process Builder and Flow to generate custom error handling. For example, you could set things up so:
- If the flow error is coming from one of the Flows that start with “Europe”, send an email to Genevieve and Post to the EuroAdmins chatter group, else
- Generate one of those new custom notifications to my desktop, send me an SMS via a Send SMS Flow Action, and create a Case.
There are a few gotchas to keep in mind, and they’re discussed in detail here.
Fiddly Builder Things That Will Make Some People Very Happy
- You can now activate flows directly from the canvas.
- When you create a New Resource from a property editor or dialog box, the resulting resource is autopopulated into the text field from where you started.
- Text Templates now again properly support rich text, although you can now toggle to plain text if you are using the template as an input to something that requires plain text (like the current Send Email action)
- There’s a new Send Custom Notification action. It’s fun. Try it.