Apex-Defined Data Types for Salesforce Admins from KatieKodes.com (Tutorial)

Learn how to easily work with complex data types using flows and Apex with Summer ’19’s Apex-defined data types feature, in this admin-focused tutorial with lots of screenshots!

Apex Defined Data Types for Salesforce Admins Tutorial

Default Flow Picklist Value Without Duplicates In New Flow Builder by Luke Freeland

Use Einstein Next Best Action with Flow by Marc Baizman

Ever wanted to inject Einstein Next Best Action into your Flows? Check out this post by Marc Baizman.

Display a Picklist of Flow Names with the FlowList Control

FlowListFSC is a specialized combo box that you can drop into any flow screen. It displays a list of all of your flows, and can be configured to show just the active ones.

I built FlowCombo because I’ve been exploring orchestration of multiple flows to solve more advanced business problems. In this prototype I’ve been working on, each of the blue buttons represents a flow that is associated with the current Case status. Click on the button and the flow runs:

In order for this to be useful, it needs to be possible for admins to customize these ‘Case Plans’ to meet their own needs. This is done with a flow called Case Plan Manager, that includes this screen:

When designing the UI above, I was able to use picklists for a couple of the fields, but I didn’t have an easy way to show a list of flows, because flows are metadata, and not records.

To solve this, I’ve built a custom component that is based on the standard lightning combo box. When it initializes, it does an Apex query using the newly available FlowDefinitionView SObject. This did not get put into the release notes, except in a mention here, so it’s a little under the radar. I’ll post more on it later.

FlowListFSC takes the following inputs:

Selected Flow ApiName is the name that has been selected by the user. When creating a new flow, putting it here in the input as well as the output causes it to be properly reloaded if the user clicks Previous from later in the flow.

Show Only Active Flows is self-explanatory.

Developer Notes

The cmp file for my component passes an object called comboBoxOptionObject. It’s the job of the Apex controller FlowListController to take advantage of a brand-new Summer ’19 api for getting flow information.

The component has to carry out two key pieces of work:

  1. Use its Apex controller to make an SObject query to get the list of flows
  2. Transform the list of flows into the format expected by the base comboBox control.

At initialization time, the component quickly calls the associated apex controller:

Component javascript controller

Here’s the Apex controller. As you can see, all it really does is make a SOQL query and return the results. It also implements the Visualforce ‘special technique’ that’s used to get a SessionId:

The helper code does the work of converting the array of objects that comes back from Apex into the form expected by the combobox base control:

Finally, the component markup invokes the base control and defines the attributes:

And that’s it. Note that there are two other new resources, FlowVersionView and FlowVariableView, which let you drill down for details on a particular Flow or Flow Resource.

How to do more with Custom Permissions in Salesforce Lightning Flows by Scott McClung


DualListBox Flow Screen Component

This new component surfaces the dual listbox in flow screens. It allows for multiple selection and returns the selected values either as a comma-separated list or (more usefully) as a collection of strings that can be looped over.

This is an installable component and is not the same as the built-in Multiselect Picklist, which looks like this:

Dual Listbox expects two key pieces of data:

  1. The full set of all of the items that could be selected.
  2. The current set of items that are selected.

Unlike the Multiselect Picklist, the Dual Listbox does not (yet) directly accept picklist or multiselect picklist field types. It accepts data in two forms: 1) a comma-separated string or 2) a flow resource that’s a collection of strings.

Likewise, you can output the set of selected values as either a comma-separated string or a string collection variable, or both.

If you output the set of selected values as a comma-separated string, you can feed that string variable back into the input to support ‘Previous’ and make sure the selections are remembered when Previous is clicked. At the moment, a bug is preventing Previous support for use cases where you store the selected values in a string collection variable.

Update: July 2019

New attributes have been added to this component. You can now:

  • make input required
  • specify the minimum and/or maximum selections allowed by the user
  • set your own help text
  • set the vertical size of the component
  • disable reordering of the selected items

These attributes can be set in the “input” section when adding the component to a screen within a flow. If you have previously installed this component as an unmanaged package, you will need to reinstall the package. For any existing implementations, you can edit the component in order to supply values for the new attributes. If you’ve never installed the package, you can get it using the links below:

Displaying Map with markers in Flow screen using Lightning Components by Terence Chiu

UnofficialSF is Looking for Volunteer Editors

UnofficialSF is Looking for Volunteer Editors

Want to help the Flow community, work closely with Salesforce Flow PM’s and build your flow knowledge? Become an UnofficialSF editor. 

The general goal we have is to make this the best starting point for flow knowledge. That means tasks like adding links to the high quality flow content being created by the flowhana, such as Jen Lee’s recent article on Flow with encrypted fields, and Rakesh Gupta’s recent post on Local Actions, searching out new undiscovered flow content, culling out obsolete material, and more. 

UnofficialSF is a WordPress site and pretty easy to work with.

Don’t worry that you’re signing up for a big commit. Think of this more like a pool of volunteers that can choose to take on small tasks and drop out anytime.. 

Interested? Contact aedelstein@salesforce.com

Summer ’19 Flow Sneak Preview

Here’s a sneak peak at some of the things you’ll be able to start playing with in a couple of weeks (either via a new pre-release org or an early sandbox upgrade).

Keep in mind our forward-looking statement. Please make your purchase decisions based only on generally available product functionality.

The Flow Builder gets Undo, Redo, and Duplicate. As well it should.

You can find elements quickly. (We’d be very proud of this one if Cloud Flow Designer didn’t already have it.)

Rich Text is back. in black. and red. and bold. (Boy, we’re funny)

We added an image button that uploads and inserts images too.

There are a couple of limitations to be aware of:

  • The added images get created into the org as ContentVersion metadata, but can’t really be packaged with the flow because ContentVersion use id’s that are specific to an org. It will take more work to figure out a solution for that.
  • At the last minute we had to disable rich text in Text Templates because we need to do some more work to make sure the rich text you create doesn’t spew html into downstream plain text fields like the email body in the Send Email flow action. We’ll have that working next release.

The “New Flow” button now generates a New Flow dialog box that provides access to flow templates.

Watch for special flow template announcements at TrailheaDX in May.

The new Automation Home page

We have big plans for the metrics and tools we intend to make available from this new page.

Flow Support for Rich Web Objects (JSON)

Our most complex and powerful feature in Summer ’19 allows incoming JSON to be converted to rich objects that can be used declaratively in Flow.

Read the deep-dive post on rich web object support.

Actions have categories to make them easier to manage in large numbers.

We haven’t enabled custom actions to be tagged with categories yet, but that’s in the works.

Additional Enhancements

  • With the new $Flow.InterviewStartTime system variable, you can use the start time of the flow interview in Decision elements, formula resources, and elsewhere in the flow.
  • Dependent Picklist component can be set to Required.
  • Custom Metadata Type Records can be used in Process Builder
  • New Build Flows with Flow Builder trail at Trailhead.
  • Flow names and properties are now available via REST (This is useful for doing things like putting a picklist of flow names on a flow screen to let a user pick which flow to go to next). previously you had to use the metadata retrieve process)