New Collection Processor Actions: 1) Count Fields and Records, and 2) Extract Fields from Records

PREVIEW Requires Spring ’20 Org

The first upgrade to the Collection Processor package is available.

Count Records And Fields takes a collection of records and returns a count. Optionally also takes a field name and a field value, and then also counts the number of records that have that particular value for that particular field. Returns both the number of matches and the total number of records.

Extract Fields from Records takes a collection and a field name, and returns a list of strings containing the values of those fields for the records. For example, if you pass in a list of Accounts and a fieldName of “Name”, you’ll get back a list of Account names. You can do this twice (once for names and once for ids) and then pass those two collections in to a Quick Choice picklist or radio button group

Flow Form Factor Helper Lightning Web Component

Ever needed to have access to the form factor of the client in which your flow is executing? Today that’s not (yet) natively possible. But with a simple Lightning web component we can determine the form factor. And as bonus, have ability to make the flow to progress automatically.

Use-case? Think of a Flow invoked by a Lightning action. The flow works fine on the desktop. But that same flow might not be fit-for-purpose for a mobile device. But there is no straight-forward way to hide the action (until we get Lightning Dynamic Forms later in ’20). You want to simply inform the user, the flow is not designed to run on a small form factor. Just Install the package or visit the Github repo. Drop the Flow Form Factor Helper Lwc component in a screen element. Tell the component whether to auto-navigate forward (default = false) and save the determined form factor in a Flow variable. There’s no more to it!

Install in a sandbox
Github repo
Blog post

Expert Flow Topics – Genetic Flow Patterns & Flow Metaprogramming

Every Flow is completely represented by a single piece of XML metadata, and you can download a Flow xml file, modify it, and redeploy it.

But of course, you don’t. Because it’s dangerous to hand-modify the XML. It’s easy to break things down there in the basement. So we try to provide Flow users with all the tools they’ll ever need right in Flow Builder and/or via public, well-defined APIs.

It is possible, though, to start with a flow (‘templateflow’), modify it using basic text parsing and substitution, and deploy the resulting flow (‘generated flow’).

Suppose that you resolved to start with an existing Flow XML file, and write some Apex code to modify it. You then deploy the modified version of the file up to an org, as a working generated Flow.

You are now programming Flows in Apex. So far so good.

Now suppose that you take that Apex code and turn it into an invocable action that you can insert into a Flow. You then create a Flow that gathers configuration data from a user using standard Flow screens, passes those inputs into your invocable action, and the invocable action then generates a Flow using the inputs the user provided? You now have a Flow Generator. You’re using Flows to generate other Flows. This is a powerful concept known as metaprogramming.

I did some experimentation this year with this, and have published a page of information about it here. There’s a repo you can look at with a working example of flow metaprogramming, used to generate custom Lead Conversion flows.

Consider another scenario: you want to change Flow Stages resources dynamically. Currently you can’t access them with conventional tools like Assignment elements. However, in a flow metadata file, they are simply represented like this:


You could start with a template flow as your baseline, and then use a Flow Generator to read Custom Metadata values, swap in the values for things like the stages name element, and deploy the resulting customized flow.

Good hunting.

New Wiki Page on Flow Stages

We’ve added a new wiki page covering Flow Stages. As is the case with most buildouts of the wiki, this isn’t about a bunch of new content but more of an aggregation of all of the known existing good content on a single focused topic page. As such, everyone should feel encouraged to add good links to wiki pages like this one. The link at the bottom of the page explains how to do it, and it’s totally safe: all edits are put in a review queue so you don’t have to worry you’ll mess anything up.

From ForcePanda: The first Invocable Action that can perform SOQL on any kind of input

Narender builds on his “world’s first” blog post on invocable actions that use the new Spring ’20 generic SObject support with a new post that shows, for the first time, an action that carries out SOQL and can be used declaratively in any object scenario.

The heart of his action is this line:

string query = 'Select '+ queryParams[0].fieldsToQuery + ' FROM ' + queryParams[0].objectApiName + ' LIMIT ' + queryParams[0].numberOfRecords;

As you can see, that’s a SOQL query. Now you’ve always been able to do that with a Flow invocable action, but you always have had to get into the Apex code and specify the exact object you wanted to use. For example, when I posted this tutorial on injecting advanced soql into flows, you can see that my code specifically declared User and Contact variables.

But Narender’s code doesn’t have to do that. And that means that you can take his action and deploy it declaratively against any kind of input.

ForcePanda’s example, powerful though it is, only scratches at the surface of the powerful SOQL actions that will be packaged up into building blocks once Spring ’20 ships. And eventually, we’ll start seeing those actions with friendly configuration UI’s, powered by Custom Property Editors.

A New Datatable Component that supports ALL Custom Objects from Tigerface Systems

Tigerface has posted a free version on AppExchange of their upcoming Datatable solution. The thing that really jumps out at me is that they’ve addressed the core limitation of the existing unpackaged datatable flow screen components: its inability to support more than a modest set of standard object types.

Tigerface appears to be solving this via metaprogramming: they actually generate the component on-demand to fit a particular specified object type. That’s a clever approach.

Comment thread here:

Navigate Everywhere – Flow Action

This builds on recent work Eric Smith did to expand the range of navigation choices available in a single, straightforward navigation action for Flow. Navigate Everywhere should be able to replace all of the previous navigation components. It provides support for navigation from a flow to:

  • a record page (in edit or view mode)
  • a new record form for an object
  • a list view (object home page)
  • a web page
  • a related object list view
  • an App page
  • a custom Tab page
  • a named page (examples include ”home”, “today”, “chatter” and a variety of community named pages)
  • a Knowledge page

Note that this navigation component is still constrained by some basic limitations constraining navigation in Flow Builder. This will work in normal lightning experience flows, including flows launched from Quick Actions, but will not work when run from inside Flow Builder or via a Custom Button. It will not work from Visualforce pages.

Supported Destination Types

Destination Type = ‘Object’

Will navigate to a New record form or a List view. Note the use of DestinationActionFilter to pass in the name of a specific list view.

Destination Type = ‘Record’

Navigates to a specific recordId in either view or edit mode.

Set Destination Action to ‘edit’, ‘view’, or ‘clone’.

Don’t use this Destination Type if you’re trying to create a new record (Use Destination Type = ‘Object’). DestinationActionFilter is not used.

Destination Type = ‘App’

Navigates to an app. For DestinationName, use either the appId or appDeveloperName to the appTarget. The appId is the DurableId field on the AppDefinition sObject. The appDeveloperName value is formed by concatenating the app’s namespace with the developer name. To find the app’s developer name, navigate to the App Manager in Setup and look in the Developer Name column. For standard apps, the namespace is ‘standard__’. For custom apps it’s ‘c__’. For managed packages, it’s the namespace registered for the package.

DestinationAction and DestinationActionFilter are not used.

Destination Type = ‘URL’

Navigates to a specific url. Use the DestinationURL field.

DestinationName, DestinationAction, and DestinationActionFilter are not used.

Destination Type = ‘NamedPage’

Navigates to a specific Named Page. Use the DestinationName field.

In Lightning Experience and the Salesforce mobile app, possible values are:

  • home
  • chatter
  • today
  • dataAssessment
  • filePreview

In Communities, the value for pageName is the URL value for a supported page. For instance, the default URL value for the Account Management page is /account-management, so the value for pageName would be account-management. The value of home is reserved for the landing page of any community in your org.

Supported pages in Communities are:

  • Home
  • Account management
  • Contact support
  • Error
  • Login
  • Top Articles
  • Topic Catalog
  • Custom pages

DestinationAction, and DestinationActionFilter are not used.

Destination Type = ‘tab’

Navigates to a specific tab. Use the DestinationName field and provide the unique name of a CustomTab. Visualforce tabs, web tabs, Lightning Pages, and Lightning Component tabs are supported.

DestinationAction, and DestinationActionFilter are not used.

Destination Type = ‘knowledge’

Navigates to a knowledge page. Destination URL is required. The value of the urlName field on the target KnowledgeArticleVersion record. The urlName is the article’s URL. DestinationName is ignored for Communities but required otherwise. Use the ArticleType API name of the Knowledge Article record for DestinationName.

DestinationAction, and DestinationActionFilter are not used.

Destination Type = ‘relatedlist’

Navigates to a related items page. Requires 1) a RecordId 2) a DestinationName like Case, 3) a RelationshipName like CaseComments and 4) a DestinationAction (which here has to be view)

Note that the Relationship Name of a related list can be a little nonintuitive. For example, suppose you want to navigate to the Opportunity Products list for an Opportunity. The relationship name is OpportunityLineItems, which you probably wouldn’t guess. Find the relationship name by going to the child object in object manager and inspecting the Lookup field that does a lookup to the parent object, as shown below:

Launching from a Utility Bar?

Check out


DestinationTypeStringAllowable values include ‘object’
DestinationNameStringWhen DestinationType is ‘object’, this must be an object name like ‘Account’ or ‘MyObj__c’.
DestinationActionStringWhen DestinationType is ‘object’, supported values are ‘list’, ‘new’, and ‘home’.
When DestinationType is ‘record’, supported values are ‘view’, ‘edit’ and ‘clone’
DestinationActionFilterStringWhen DestinationType is ‘object’ and DestinationAction is ‘list’ or ‘home’, this allows the specification of a specific list view by name. Example ‘mycustomlistview’
Destination URLString
Relationship NameStringUsed with Destination Type = relatedlist
Destination Record IdString


Unmanaged Package 1.0.1 (small error message improvements)

Old Versions

Unmanaged Package 1.0

View Source


Get a Layout’s Field Names – Flow Action

With the publication of the RecordDetail flow screen component, it became easy to get flow to show any list of field names you choose to give it. In many use cases, you might want to leverage your existing Layouts, particularly in situations where you’ve customized layouts on a per-record-type basis. Other recent tools make it easy to let users select record types and obtain layout id’s. This action takes a Layout Name and Object Name and returns a CSV string of the layout’s field names. To see this action in action, check out this video.


Layout NameStringexample “Account (Marketing) Layout”
Object NameStringexample “Account”


layoutFieldsCSVStringComma-separated list of layout fields


Version 1.2.3 Unmanaged

Install this action as part of the QuickChoice managed package or just grab the source.

Get the Layout Corresponding To a Specific RecordType/Profile Combination – Flow Action

Layouts often differ substantially from recordType to recordType and from profile to profile. This action takes a recordTypeId and a profileId and returns that combination’s current LayoutId. One use of this is dynamically generating flow screen layouts with the RecordDetail flow screen component. To do this, after using this action to retrieve a LayoutId, use the GetLayoutFields action to retrieve the list fo field names from that layout. You can then pass the list of field names to RecordDetail to generate a customized record detail right in your Flow screen that maps to the layout. To see this in action, check out this video.


recordTypeIdStringThe ID of a recordType
profileIdStringThe ID of a profile. Note that you can quickly generate this in Flow by creating a formula of $User.profileId




Install this action as part of the QuickChoice managed package or just grab the source.

Quick Choice – Improved Picklists and Radio Buttons for Flow

Quick Choice is a flow screen component that provides some features that aren’t available in the current picklist and radio button implementation in Flow Builder.

Features that it provides:

  1. Accepts as an input a pair of string collections.
  2. Can accept a default value that’s dynamically determined by your Flow
  3. Can generate picklists from existing picklist fields with optional filtering based on record type
  4. Supports ‘None’ Value and Requiredness
  5. Choices can be formatted as Radio Buttons, Picklist, or Visual Cards
  6. Visual Cards can be displayed with or without Icons or Images
  7. Visual Cards can be displayed in single or dual columns
  8. Specify the width of the picklist.

Quick Choice supports both picklists and radio button groups, set by passing in a value for Display Mode. For this document, we’ll always use “Picklist”. There’s no support for multiple select. If you need that, consider the Dual List Box flow screen component.

Creating Choices from String Collections

Use String Collections as your inputs by setting Input Mode to “Dual String Collections”. Pass in one collection for Labels and one for the underlying values (A typical use case for this is when you want your user to see a list of friendly labels, but you need to make sure that you can get the recordId of the selected label.)

Example: You want your flow to let the user choose a record type from a picklist and then display the layout corresponding to that record type (This is demonstrated in the video above). The Quick Choice package includes several utility actions that make this easy. You first start out with the GetRecordTypeInfobyObject action, which returns separate collections of recordTypeNames and Ids. You then use those as inputs to a QuickChoice control. When the user makes their choice, you use a couple of additional utility actions to extract the Layout fields for the layout that corresponds to the combination of the selected RecordType and the running user’s profile. The layout fields are then passed to the new RecordDetail flow screen component.

Tip: If you are starting with a collection of SObjects instead of a collection of Strings, you can use the ExtractFieldFromCollection flow action (provided in the same package as SmartChoice) but you’ll need to modify its Apex, swapping the references to “Account” for your chosen SObject.

Creating Filtered Choices from Picklist Fields

Many orgs take advantage of the ability to create record-type-specific sets of picklist values for picklist fields like Account.Type and Account.Rating. Flow already enables the easy creation of Picklist Choice Sets, which point at an existing picklist field. But you can’t filter a Picklist Choice Set on a specific Record Type. Quick Choice allows you to do that.

Start by setting the Input Mode to “Picklist Field”.

Pass in strings for Object Name and Field Name. (You can also use Object and Field picker)

Pass a record type ID in. If you don’t, the component uses the ID of the standard “Master” record type ID, which will result in no filtering. This package includes a useful utility function called GetRecordTypeInfoByObject that will return the record type Id’s and Labels for a given object type name. The video above shows how you can use QuickChoice first to let the user select a record type and then to show a set of filtered picklist fields. Learn more about using a Flow Action to retrieve the available record types so your user can pick the one they want.

Displaying Choices as Visual Cards

Set the Display Mode to “Card” and the Input Mode to “Visual Text Box” .

Pass in a collection of Strings in Choice Labels for the visual card headers, a collection of Strings in Choice Values for visual card descriptions and optionally a collection of icon and/or image references in Card Mode – Choice Icons for visual card icons.

If you are displaying icons, set the Card Mode – Include Icons in Display Box? parameter to True and set the Card Mode – Icon Size parameter.

The visual cards are displayed in a single column by default. Set the Card Mode – Number of Display Box Columns (1 or 2) parameter to 2 to display dual columns.

Visual Cards without Icons

Visual Cards with Icons

Dual Column Visual Cards

Requiredness Support

You can set the Required field to $GlobalConstant.True. If you do, Flow will prevent screen transition if the user selects ‘None’ or makes no selection at all.

Controlling the ‘None’ Choice

By default, there will be no “None” Choice. To add one, set the input “Allow None To Be Chosen” to $GlobalConstant.True.

Multiselect Picklists

Not supported directly with this component, but check out Dual List Box.


General Attributes

Master LabelStringThe main label for the picklist or radio button group
Display ModeEnumEither “Visual”, “Picklist” or “Radio”, depending on which control you want
Input ModeEnum“Single String Collection”, “Dual String Collections”, “Picklist Field”, or ” Visual Text Box ” are currently supported
RequiredBooleanWill prevent transition if set to {!$GlobalConstant.True}
ValueStringThe selected value. This can be passed into QuickChoice, allowing you to set the default value dynamically.
Allow None To Be ChosenBooleanSet this to true to include a None choice. (For Input Mode “Picklist Field” only)
Set Width in PixelsIntegerSet the width of the component for Picklist & Radio Buttons (Default 320 pixels)
allValuesString[]The complete set of values provided to the user. (V1.3+)
allLabelsString[]The complete set of labels provided to the user (V1.3+)
selectedLabelStringThe selected Label (V1.3+)

Additional Attributes When Using Input Mode = “Single String Collection”

Choice ValuesString CollectionThe values of your choices (The same collection will be used for Labels and Values)
The selected Label/Value will be returned by the component

Additional Attributes When Using Input Mode = “Dual String Collections”

Choice LabelsString CollectionThe labels of your choices
Choice ValuesString CollectionThe values of your choices (should be unique)
The selected Value will be returned by the component

Additional Attributes When Using Input Mode = “Visual Text Box ”

Choice LabelsString CollectionThe labels of your choices (should be unique)
The selected Label will be returned by the component
Choice ValuesString CollectionThe values of your choices (This is provided as extra descriptive text in the visual card)
Card Mode – Choice Icons
String CollectionMix and Match either:
– Icon names formatted as icon_type:icon_name (Example “utility:attach”)
See complete selection at
– Image names formatted as filename.ext (Example “astro.png”)
Referenced images must be included in a ZIP file referenced by a Static Resource* named Quickchoice_Images
Card Mode – Include Icons in Text Box?BooleanDisplay the provided icons in the visual card
Card Mode – Icon SizeStringOptions include x-small, small, medium, or large. This value defaults to medium.
Card Mode – Number of Textbox Columns (1 or 2) String1 or blank (default) for a single column or 2 for dual columns

Additional Attributes When Using Input Mode = “Picklist Field”

Object Name (for Picklist Field)StringExample: “Account” (this component no longer uses the combined “Account.Type” as an input)
Field Name (for Picklist Field)StringExample: “Type” (this component no longer uses the combined “Account.Type” as an input)
Record Type IdStringThis will default to the id of the Master record type

*NOTE: Static Resource
The versions 1.27+ package includes a Static Resource named Quickchoice_Images. To access your own images, create a ZIP file containing all of the images you want to reference and then, in Setup, Edit the Quickchoice_Images Static Resource and reference your ZIP file with the “Choose File” option. To learn more about Static Resources and creating ZIP files, see the Instructions for my ersQuickSwitchApp component.

Install Package

Version 1.4 – 4/19/20 – Eric Smith

Version History

Version 1.3

3/2/20 Eric Smith
v1.27 Added ability to display both images & icons on visual cards (Thanks again to clifford-fra for the update)

Unmanaged v1.27 (Production/Developer)
Unmanaged v1.27 (Sandbox)

2/6/20 – v1.26 Display a Visual Card as preselected when passing in a default value (Thanks to clifford-fra for the fix)

Unmanaged v1.26 (Production/Developer)
Unmanaged v1.26 (Sandbox)

Unmanaged V1.24

See Release Notes

1/16/20Eric Smith
v1.23 – Added an option to display the visual cards in a single or dual columns

Managed V1.23 (Production/Developer)
Managed V1.23 (Sandbox)

1/3/20 -alexed
v1.20 – changed actions to global from public to make them visible in flow builder.

12/31/19Eric Smith Enhancements
v1.17: Added visual text box selection with or without icons. Fixed error handling when Required is set to True

v1.13: Fixed bug with defaults on picklist control. Added flag to allow or disallow a ‘None’ choice

View Source