Posts

New features have just been added to the Datatable component

For the latest on the Datatable component, please go here: Datatable – Lightning Web Component for Flow Screens

DatatableV2 Flow Screen Component

There is now a new Output Parameter that passes back the number of Selected Records.  This helps with being able to easily check later in your Flow to see if any records were selected.  This feature can also be used to set Component Visibility for components on the same Screen as the Datatable.

Another new Parameter lets you set the Datatable as Required.  This will keep the User from advancing past the Screen if no records are selected.

When just a single record is selected in the Datatable, a new SObject Output Parameter will be populated with the single selected record in addition to the standard SObject Collection Output Parameter.

Another new feature for Datatables displaying just a single record is the appearance of a Clear Selection button.  This button will be made available once the single record has been selected using the standard Radio Button.

You can now add a Header Icon and Header Label to the entire Datatable.

Additional Enhancements and Bug Fixes include:

  • Spinners will be displayed when sorting & filtering data
  • Picklist and Multi-Picklist Labels will be displayed instead of the API Names
  • The link to the record for the object’s standard Name field can be suppressed
  • The Configuration Helper now uses the Flow Base Components version of the DualListBox component
  • Column Field Names attributes are now recognized with case insensitivity and even if missing the __c suffix

Flow Use Case – Use Before Save flow to update the total login count on the user record

Trying to report on user login history using standard Salesforce reporting can be tricky. If you would like to see each users’s last login and his total login count for the last 6 months, sorted by login count, you have to use some external Excel manipulation. I was looking to get a simple report I could use to monitor login usage.

Simple Login Report



I was able to provide a nice solution using the new before save flow record trigger. The first step is to create a number field on the user object to hold the login count. Then create this simple before save flow. This flow updates the custom field on the User object. By incrementing a counter every time a login history is generated, each user shows a login count. Then, at any time, you can generate the report by simply reporting on your users.

User Login History Flow
Get Login History Records
Confirm records are returned (Null Check)
Use the record count operator to assign the record count to the user field
If no records are returned, assign zero login count

This use case can be easily adapted to rollup any related records on other objects. I can think of several examples: count of opportunity contact roles on opportunity, count open cases on a contact, count of won opportunities on an account.

How to use ISCHANGED and PRIORVALUE in Before Save Flows by GORAV SETH

GORAV SETH demonstrates how you can use ISCHANGED and PRIORVALUE in Before Save Flows
Check it out

A Flow Screen Component that plays sounds

Created by Yumi Ibrahimzade

ABOUT
This is a Lightning Component that plays a sound effect.
It can be used on Flow Screens and Lightning Pages.
In order to play a sound, you have to upload the sound file as a Static Resource and then enter the name of the file to the “Sound File” parameter.

INSTALLATION

PARAMETERS
Sound File – Enter the name of the sound file.

CONSIDERATIONS
This component loads the sound file from Static Resources and plays it. So it is recommended to use smaller file sizes, otherwise it might take some time to load the file.

HOW TO USE
1- Upload the sound file as a Static Resource.

2- Add “SoundCMP” to your Flow Screen.
3- Enter the name of the sound file to the parameter called “Sound File”.

Update N Records in Flow Without a Loop by Jessie Rymph

Jessie Rymph from the blog https://unhandledsunshine.com/ has published a post showcasing two new invocable actions available on this site showing how to Update N Records in Flow Without a Loop

Launch a flow from a formula field

The first post in a new series on the Salesforce admin blog demonstrates a novel way to launch auoto-launched flows from a formula field on a report. This has several very interesting use cases
Check it out

Extend the Power of Flow with External Services

Lightning Flow already empowers you to declaratively automate your business processes within Salesforce. But what if your business processes require integrations between Salesforce and other non-Salesforce services? Chances are that customer service agents who use Salesforce to track and resolve support cases would also need to access information from and/or submit changes to another backend system. Or perhaps you want a Flow to create a new record in Salesforce as well as post a message in Slack to notify the team. These are scenarios where you can leverage External Services to extend the ability of Flow to automate processes beyond Salesforce!

External Services provides a declarative way to access external business processes, whether they are proprietary APIs, public APIs, or other Salesforce APIs:

For any REST API that you want available as a callout from Lightning Flow, you just need to register the OpenAPI 2.0 specification for that API, so that it will be available as an action in Flow.

Configuring Flow to Integrate with an External Service

To support this integration, you just need to provide Salesforce with the following information:

  1. Named Credentials
    • Where to configure this: Setup -> Named Credentials
    • What these configurations tell Salesforce: Where is the external service being hosted (domain URL), and what credentials do we need to send for authentication?
  2. External Services:
    • Where to configure this: Setup -> External Services
    • What these configurations tell Salesforce: Where the OpenAPI 2.0 specification is located (relative to the domain URL of the Named Credential), and/or what the API specification is. The specification describes what API callouts Salesforce can make to the external service.
  3. Flow Action:
    • Where to configure this: Setup -> Flow
    • What these configurations tell Salesforce: Which action / callout you want to make to the external API, what input parameters you want to send, and what variable you want to use to store the response.

Example

This example shows how to the register the OpenAPI 2.0 specification for the Swagger PetStore API, as well as configure a callout to the PetStore API in Flow:

Named Credential:

External Service:

Flow – Add “findPetsByStatus” action:

Flow – Configure Input Parameters and Store Response:

Learn More

Here are some more resources for you to learn more about External Services:

External Services Trailhead

Katie Kodes’ Tutorial

Flow Use Case – New Task Button with picklist for selecting the record type

When our org migrated to Lightning, we were faced with an interesting issue: we had many task record types and in order to enable our end users to create tasks from the activity composer, we had to create a different quick action for each task record type. The result wasn’t pretty

Too many tabs

Our users wanted a simple button where they could create a task with one click and be able to select the task record type.
When I set out to build the solution, I started by using a Get Records element to query the record type object but soon realized that I can’t filter this list based on the record types available to the current user.

I was able to provide a nice solution using the new invocable action and quickChoice component found here on this site. I used the Get Record Type Info by Object action to generate a list of record types available to the current user. Then I fed the record type labels and Ids into the Quick Choice component. Finally I created the task and used the Navigate to Record action to open the new task in edit mode.

Get the available record types
You need to check this box to store the output value
The new task Id is fed into this action
And this is the completed flow
Here is the end user experience

Preventing duplicate junction object records by GORAV SETH

GORAV SETH demonstrates how you can use the new flow before save trigger combined with duplicate rules to prevent creation of duplicate junction object records.
Check it out

Get Record Type Info by Object – Flow Action

This action can be used to generate a list of record types for a specific object. This can be useful when you would like to present a record type selector to the user. Can be used as inputs to the QuickChoice by setting Input Mode to “Dual String Collections”. Pass in one output collection for Labels and one for the underlying values

Inputs

AttributeTypeDescription
Object NameStringAPI name of the target object example “Task” or “MyObject__c”
ignoreMasterRecordTypeBooleanIf “on” then “Master” will not be added to the list of record types
onlyReturnActiveRecordTypesBooleanIf “on” then only active record types will be added to the list
onlyReturnRecordTypesAvailableToCurrentUserBooleanIf “on” then only record types available to the current user will be returned

Outputs

AttributeTypeDescription
errorsStringcaptures details of any error that occurred
recordTypeIdsStringIds of the records types.
recordTypeNamesStringNames of the record types.
defaultRecordTypeNameString
defaultRecordTypeIdString

Installation

1.1 Unmanaged 5/13/21 – Added outputs for the default Record Type

Source