Add an Object And Field Picker to your Flow
/6 Comments/in Flow/by Alex EdelsteinA growing number of Flow components and actions involve selecting either 1) an object type (“Account”), or 2) a field name (“Account Number”) or 3) both.
This Flow screen component provides a pair of picklists that you can drop into a screen that will show either the full set of available values in your org or a subset that you specify.

Available Parameters
masterLabel – Master label of the component
objectLabel(default "Object")– Label for “Choose Object” field
fieldLabel(default "Field") – Label for “Choose Field” field
objectType – initialization value for object name, supports all standard and custom objects
field – initialization value for field name, should be valid field on selected object, can not be specified if objectType is empty
availableObjectTypes – comma separated list of selectable object names, which should be available to select in objectType field. If this value is not set, objectType will show many existing UI API supported standard and all custom objects. If this is set to All, all Salesforce objects will be available in the Object list but the Field list will not be available for non UI API supported standard objects.
availableFields() – comma separated list of supported reference types, f.e. “User, Account” will result only fields of these types to be shown in “set field” component, all other references will be avoided.
isALlowAll (default = false) – Set to True when displaying ALL Salesforce objects
disableObjectPicklist (default = false) – Object picklist is visible, but disabled. If this is true, a value must be provided for objectType
hideObjectPicklist (default = false) – Object picklist is hidden. If this is true, a value must be provided for objectType
hideFieldPicklist (default = false) – will show only object selection and field select will be hidden
displayFieldType (default = false) – if field is selected it will show field type
allowFieldMultiselect (default = false) – supports multiple fields (available in versions after 8/25)
Developer Notes
This component is available in the Flow Base Packs library, and we recommend that you install & use it from there instead of adding it separately to your projects.
9/21/24 Christopher Strecker – (FlowScreenComponentsBasePack v3.3.8 or later)
Implemented masterLabel property on the HTML template. This property was captured but was not implemented on the template.
Removed the property testproperty because it was not used anywhere and looked to be remnant of debugging.
Updated the field property to allow multiple selected fields to be passed into the component when allowFieldMultiselect is true.
12/20/20 – Eric Smith – Added option to include ALL objects in the Object picklist
Installation
This component is part of the Flow Base Packs package libraries.
Version History
Install Package OBSOLETE
The package includes a sample flow called Select Object And Field Demo.
Adding a Manual Sharing Button to Records with Lightning Flow
/11 Comments/in Flow/by Alex EdelsteinIn Salesforce Classic, you can manually control sharing on a per-Record basis for any object that doesn’t have Public Sharing Settings. You can then put a useful Sharing button on record pages. The different sharing permissions you’ve granted can then be managed:

This feature isn’t available yet for Lightning so we’ve built a Flow Action called Set Sharing Manually that does it. It demonstrates the use of Lightning Web Components to create screen components that do useful ‘member management’ Salesforce administration. The component is based on seminal work by Shane McLaughlin.
Watch the video above to see it in action.
About the Package
This action is packaged with a sample object called Sharing Test Object, that comes preinstalled with a Set Sharing button. Keep in mind that per-record sharing only works on objects that have their Organizational sharing set to either Private or Public Read Only. In other words, if everyone automatically has full Read/Write access to an object type, there’s no point in using per-record sharing. In many orgs, most or all object types have Read/Write access and don’t enable manual sharing. So this capability is somewhat specialized. Sharing Test Object comes preset to Public Read Only, so you can assign sharing manually. Feel free to delete Sharing Test Object and the demo flow that also comes in the package.
Installation
1) Install the package (or push the source to a scratch org).
(or push the source to a scratch org).
2) Go to Permission Sets and assign the Sharing Demo permission set to your current user. This will cause the Sharing Test Object to show up in your App Launcher.
3) Using App Launcher, create a sample Sharing Test Object record. Note the “Set Sharing” button that comes preinstalled on the Sharing Test Object page layout.

Trying It Out
Click on Sharing, and you’ll see two tabs you can use:

Select one of the types of entities and click Search to retrieve the full list of records. (SFDX-only note: scratch orgs show a bunch of sample Roles, but these Roles do not work with this action. Create your own orgs in a scratch org to try this feature out).
Configuration
This component has the following attributes:
| addTabName | The label used for the ‘Add’ tab | |
| editTabName | The label used for the ‘Edit’ tab | |
| selectionRequired | Boolean. validates that at least one entity has been selected. | |
| recordId | The Id of the record being acted upon. |
Developer Notes
The UI that appears in the flow screen is made up of three Lightning Web Components, and the source can be found here. The LWC components are decoupled from the specific of Sharing, and there are other potential use cases for this UI. Think of it as a general Lookup for Users, Roles, Queues, Groups and other entities, and a list building tool to assemble a list of these entities. For example, we have a variant “in the lab” that manages Initial Submitters for Approval Processes and another that manages Approvers for Approval Process Steps.
Next Best Action Recommendations Component Available for Flow Screens
/1 Comment/in Flow, Next Best Action/by Alex EdelsteinThe Next Best Action component is available for use in Flow Screens.

Additional tools for incorporating NBA Recommendations into Flow, including open-source components that can be customized.
Adding Lightning Web Components to Flow Screens
/18 Comments/in Flow/by Alex EdelsteinFor the last two years, Flow creators have been able to add lightning component to Flow Screens. This has powerfully extended the capability of screens. We’ve had a great time creating reusable components as a community, and many of those components are available for use to all parties.
The underlying web technology enabling these components, known as Aura, has served Salesforce well, but it’s more than 5 years old, and that’s a long time when it comes to changes in web technology. Salesforce recently released a major upgrade to its web technology called Lightning Web Components, and it’s now possible to embed this new generation of components into Flow screens. Let’s take a look at how it’s done.
In this demonstration, we create an LWC that allows the user to manually add and manage sharing settings on a record. This allows a Sharing button to be placed on Lightning record pages. The guts of this component consist of code written by resident Salesforce evangelist Shane McLaughlin.
To get an LWC to appear in Flow’s Screen Builder, you add a ‘lightning_FlowScreen’ target to the component’s meta file:

Attributes and Properties
To expose attributes from the LWC, you first use @api in the LWC’s javascript, as is standard for any property you want to make accessible outside of the component:

Then you additionally specify which of these public properties should be made visible in Flow by adding a targetConfig section:

The type field supports the same types that Flow supports with aura components. That includes specific Sobjects like “Contact” and specific SObject collections like “Account[]”. You can also use this interface to directly publish access to your apex class data structures for declarative manipulation in Flow . This extremely powerful technology is discussed at length here.
Note the following syntax for specifying SObjects and Apex Classes:
- @salesforce/schema/<name of sObject>
- apex://<name of Apex class>
Add array notation if it is a collection: []
As of Summer ’20, you can now use generic SObjects. Here’s an example:
<targetConfig targets="lightning__FlowScreen">
<propertyType name="T" extends="SObject" label="Object API Name" description="Select the api name of the SObject this component is going to be looking for" />
<property name="selectedRecord" type="{T}" label="The selected Record" role="outputOnly" description="The SObject the user has selected" />
</targetConfig>
<targetConfig targets="lightning__FlowScreen">
<propertyType name="T" extends="SObject" label="Object API Name" description="Select the api name of the SObject this component is going to be looking for" />
<property name="selectedRecord" type="{T}" label="The selected Record" role="outputOnly" description="The SObject the user has selected" />
</targetConfig>
See this post for more detail.
Namespaces
With a namespaced org you have to include the namespace in the type string using the namespace prefix. So, for SObjects it would look like type=”@salesforce/schema/myNs__CoolCustomObject__c”. For apex types:”apex://myNs__MyApexClass”
Input and Output Control via Roles
The ‘role’ parameter can be added to property elements inside of targetConfigs. It has been created specifically to provide support for Flow’s ability to limit access to inputOnly or outputOnly. If no role is specified, the property is available in both directions.
Troubleshooting
If you hit this error: unable to find field dataType for complex reference: foo, you may need to set a default value on your attribute. For example, this error will occur if the value attribute is not set to an empty string here:

Example: Creating Contacts in Javascript and Passing Them to Flow
The component Contacter exposes two attributes. One is a Contact and the other is a collection of Contacts:

In the Flow, the outputs from these attributes are mapped manually to corresponding Flow resources:

Here’s an example of the corresponding javascript that creates new contacts and assigns them to the public attributes where Flow can get them:

Considerations When Working With Targets
Be Careful about Mixing Your Targets
The support mentioned above for SObjects and Apex Classes works only for Flow and not for other targets like lightning__RecordPage. So something like this will fail:

This can be hard to debug because each target has its own validation and the errors reported back don’t specify which target is the source of the difficulty. So you can get into a situation where you think your new Flow interface is complaining when it’s actually a problem being reported by App Builder.
Each property has to meet the requirements of each Target that mentions it.
Example: App Builder (and thus lightning__RecordPage, lightning__AppPage, lightning__HomePage) requires that if you add a ‘required’ attribute you also have to add a ‘default’ attribute. Flow does not have this requirement. If you try to add the same attribute to both sections, you’ll have to satisfy the combination of their constraints.
A good practice is to separate the App Builder targets from the Flow target, like this:

This helps but does not eliminate all possible interaction headaches. In the example above, Flow is forced to add a default attribute to editTabName because editTabName is also used in the AppBuilder targets, where that required/default issue is enforced. But it makes it easier to debug because you can comment out one set and see which validation is causing problems.
Events and Notification
Unlike Aura, the parent component doesn’t automatically learn when something changes in the child component. This takes some getting used to for old Aura hands.
There are two scenarios where this matters. For all of your LWC’s, think of the Flow Runtime as the parent container that needs to be notified about changes that need to be available external to your component. Any attribute that you intend to be used downstream in the Flow must be constantly reported to the Flow Runtime whenever the value changes in your component. (Likewise, if you have an lwc with lwc child components, you’ll have similar issues).
To notify Flow of changes in the value of an attribute in your component, the component must fire the FlowAttributeChangeEvent event.
In the following example, a ToDo LWC dispatches a FlowAttributeChangeEvent when a new item is added to the list of To Do’s:
import { LightningElement, api, track } from 'lwc';
import { FlowAttributeChangeEvent, FlowNavigationNextEvent } from 'lightning/flowSupport';
export default class Todos extends LightningElement {
@api
availableActions = [];
@api
get todos() {
return this._todos;
}
set todos(todos = []) {
this._todos = todos;
}
@track _todos = [];
get hasTodos() {
return this._todos && this._todos.length > 0;
}
handleUpdatedText(event) {
this._text = event.detail.value;
}
handleAddTodo() {
this._todos.push(this._text);
// notify the flow of the new todo list
const attributeChangeEvent = new FlowAttributeChangeEvent('todos', this._todos);
this.dispatchEvent(attributeChangeEvent);
}
handleGoNext() {
// check if NEXT is allowed on this screen
if (this.availableActions.find(action => action === 'NEXT')) {
// navigate to the next screen
const navigateNextEvent = new FlowNavigationNextEvent();
this.dispatchEvent(navigateNextEvent);
}
}
}
See additional pieces of the To Do example
Validation
To provide custom validation, create a function called “validate” in your js file:
@api
validate() {
if(/* true conditions */) {
return { isValid: true };
}
else {
//If the component is invalid, return the isValid parameter as false and return an error message.
return {
isValid: false,
errorMessage: '/*A message that helps your user enter a valid value or explains what went wrong.*/'
};
}
}
Navigation
To programmatically transition a Flow with an LWC component, you dispatch an event using this syntax:
import { LightningElement, api } from 'lwc';
import { FlowNavigationNextEvent } from 'lightning/flowSupport';
export default class NameOfYourComponent extends LightningElement {
@api
handleGoNext() {
const nextNavigationEvent = new FlowNavigationNextEvent();
this.dispatchEvent(nextNavigationEvent);
}
}
The supported events are:
- FlowNavigationNextEvent
- FlowNavigationBackEvent
- FlowNavigationFinishEvent
- FlowNavigationPauseEvent
Data Sources
Attributes that use data sources will not show up in Flow Builder as mappable inputs or outputs. The simplest thing to do here is just assume that Flow doesn’t work with datasource properties yet. However, the attribute will function properly. So for example, you could use an attribute with a datasource to populate a picklist. But you could not directly pass in a default value for that picklist. You’d have to do it indirectly, passing in the value to an attribute that Flow can see and then copying it once you’re in your code.
Wire Service Considerations
It can be a little tricky to get wire services interacting properly with incoming flow data. Details here.
Examples
Sample Gists
https://gist.github.com/alexed1/e3e580103375120ca2dc1374bb4f73ff
New Flow Action: Convert Files to Attachments
/0 Comments/in Flow/by Alex EdelsteinThis action takes a collection of Content Document Links and returns a collection of Attachments. This is useful when you want to send files as attachments in email, because the Salesforce email infrastructure is still attachment-based. For more information on how these entities interact, see this and explore the test flow included in the package below.
This action comes packaged with the Send HTML Email Flow action.
Flow Email Now Supports Attachments and Organization-Wide Email Addresses
/1 Comment/in Flow/by Alex EdelsteinThe recently created Send HTML Email Flow Action has been upgraded to add attachment support and support for Organization-Wide Email Addresses. In addition, it comes packaged with a new ConvertFilesToAttachments Flow Action useful when working with Salesforce Files.
New Flow Template: Create Draft Article From Case
/0 Comments/in Flow/by Alex EdelsteinFound this flow from Derek Anderson. Check it out.
New Lightning Record Page Component
/0 Comments/in Flow/by Eric SmithDani Finkelshtein was looking for an enhancement to my Quick Action Button page component. Rather than a single button, she wanted to be able to show up to 5 buttons that could each launch a Quick Action. Check out the new Quick Action Buttons component.

Dynamically Launch Autolaunched Flows from Other Autolaunched Flows
/0 Comments/in Flow/by Alex EdelsteinA more modern version is available here.
In this post, we recently discussed how you can dynamically launch new screen flows from a screen flow by creating a flow URL and opening it with your browser.
Recently, I had a similar requirement to launch autolaunched flows dynamically from a parent autolaunched flows. In this flow app, the user runs a definition flow to select the flows that they’re going to want run in the future under certain conditions:

The screen above uses the Flow List screen component to show lists of flows. In theory, I could add a big decision element with a subflow element for every flow in this list, but 1) that’s a lot of work and 2) if new flows are added, I want this to just work.
The autolaunched flow that uses this information triggers via Process Builder. It has the name of the flow. Launching the flow isn’t hard to do in Apex, so it was easy to create a Flow Action that makes this action available for admins.
The package comes with the test flows visible in the video.
- Create a Next Best Action Employee App – Part 2June 30, 2020 - 3:20 pm
- Create A Next Best Action Employee App- Part 1June 30, 2020 - 3:19 pm
- Adding Lightning Web Components to Flow ScreensOctober 21, 2019 - 7:45 am
- The Top 10 Things You Want to Know About the New Flow B...February 11, 2019 - 5:36 pm
- Salesforce Einstein Next Best Action “Getting Started”...February 3, 2019 - 2:34 am
- Send Rich Email (Send HTML Email Action)September 12, 2019 - 4:15 pm
- Quick Choice – Improved Picklists and Radio Buttons...December 25, 2019 - 12:57 pm
- Collection Processors for Flow (Sort, Filter, Find, Join,...December 17, 2019 - 12:18 am
- Send Richer Email with the ‘Send Better Email’...August 11, 2020 - 10:23 am
- Create a Next Best Action Employee App – Part 2June 30, 2020 - 3:20 pm
- Create A Next Best Action Employee App- Part 1June 30, 2020 - 3:19 pm
- Adding Lightning Web Components to Flow ScreensOctober 21, 2019 - 7:45 am
- The Top 10 Things You Want to Know About the New Flow B...February 11, 2019 - 5:36 pm
- Salesforce Einstein Next Best Action “Getting Started”...February 3, 2019 - 2:34 am
- Using Flow, Prompt Builder, and Multimodal AI to Validate...May 19, 2026 - 12:35 pm
- Minor update to Datatable (v4.3.7)May 15, 2026 - 2:35 pm
- New String Normalizer Apex ActionApril 15, 2026 - 11:37 am
- From: Sravya Yellapragada – Unlocking Payments Processing...March 12, 2026 - 6:59 am
- […] you need to parse it somehow. Since there is no...March 28, 2026 - 11:32 am by How to Process Images and PDFs in Flow Using Prompt Templates – studoi.com
- […] you need to parse it somehow. Since there is no...March 28, 2026 - 12:53 am by How to Process Images and PDFs in Flow Using Prompt Templates - Salesforce Time
- […] first is more complex and can solve almost anything,...March 24, 2026 - 5:19 am by Can you calculate follow-up time for us? - Blog Martina Humpolce
- […] that case, you can use a local action that doesn’t...March 7, 2026 - 9:09 am by How to Fix MIXED_DML_OPERATION Error in Salesforce Flow – studoi.com
