25 New Flow Exercises from SalesforceFlowLab

We came across this new content site:

It has a list of 25 different Flow posts/tutorials/exercises/walkthroughs.

Check it out!

From Nick Sauer: Present a Map with Markers in Flow

The multiMapFSC component is an LWC upgrade of the previously available Aura version of presenting a map inside of Flow. Additionally, there are a few upgrades included to toggle between address or coordinates (Latitude & Longitude), as well as to show or hide the list view next to the map.

Preparing Our Input Data

In the Flow, we need to build a collection variable of type ‘text’ that will be passed into the LWC. This will be a semi-colon delimited string of either address or coordinate attributes, along with identifiers that you want to use for the map and markers.

  • Address: City;Country;PostalCode;State;Street;Name;Icon;MarkerValue
    • Example: Austin;USA;78767;TX;312 Constitution Place Austin, TX 78767 USA;Edge Communications;standard:account;001B000001KKZavIAH
  • Coordinates: Latitude;Longitude;Name;Icon;MarkerValue
    • Example: 30.267153;-97.743057;Edge Communications;standard:account;001B000001KKZavIAH

A common way to do this will be to query for the records you want to display on the map, then loop through those results and assign them to your collection variable based on a formula. In the example shown below we are doing this based on the Address, but this can also be done using Latitude and Longitude fields only– provided coordinates attribute is set to ‘true’ in the Flow.

Following is an example of the formula used against each record in the Loop…

Address: {!Loop_Through_Accounts.BillingCity}&”;”&{!Loop_Through_Accounts.BillingCountry}&”;”&{!Loop_Through_Accounts.BillingPostalCode}&”;”&{!Loop_Through_Accounts.BillingState}&”;”&{!Loop_Through_Accounts.BillingStreet}&”;”&{!Loop_Through_Accounts.Name}&”;”&”standard:account”&”;”&{!Loop_Through_Accounts.Id}

Coordinates: TEXT({!Loop_Through_Accounts.BillingLatitude})&”;”&TEXT({!Loop_Through_Accounts.BillingLongitude})&”;”&{!Loop_Through_Accounts.Name}&”;”&”standard:account”&”;”&{!Loop_Through_Accounts.Id}

This individual collection of values representing a location is then added to the Collection variable including all the locations/markers we want to show on the map.

Setting up the Map Component

Once we have the input collection built of the different markers to show, we’ll fill out the flow inputs according to the follow table and example.

ParameterLabelIOInformation
markerListMarker ListXList of String. Pass in Address attributes or Latitude/Longitude depending on coordinates flag. Default expectation is for Address. See instructions/ReadMe for additional information.
titleMap TitleXString. Title to appear above the map.
showListViewShow List View?XBoolean. Set to true to show the List View on the map. Default is false (hidden)
coordinatesUse Coordinates?XBoolean. Set to true if you will pass in coordinates (Latitude and Longitude) instead of Address. Default is false (meaning Address will be used)
selectedMarkerValue Selected MarkerXString. This is the ‘MarkerValue’ passed in to the markerList for the corresponding marker selected.

See It in Action!

When running the Flow, we’ll then see a List View of the input markers (provided showListView is true) and/or a map of the markers.

Note that selecting a marker will grab the value that we’ve passed in to the input collection as ‘MarkerValue’. In our example, I’ve used Account.Id in the MarkerValue place of the formula (see underlined value in example above), so I’ll have that available as an output to the Flow and can use it going forward.

As one example of many possible use cases, consider allowing a user to select and update an Account attribute from this map (below). Alternatively, there are many scheduling applications possible here, including locating Service Resource in FSL and selecting for messaging, assignment, etc. based on their current location.

Install

Unlocked Package

References

Source Code: https://github.com/alexed1/LightningFlowComponents/tree/master/flow_screen_components/multiMapFSC

Referenced Aura version by Terence Chiu

New features have just been added to the Datatable component

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

From M Hamza Siddiqui: New Styling Options for RecordDetail Screen Component

Nice add, Hamza!

Styling Options

You can apply SLDS classes to the MAIN BOX of this Screen Component.

The major classes for themes are: 
slds-box slds-theme_default
slds-box slds-theme_shade
slds-box slds-theme_shade slds-theme_alert-texture

More Details: https://www.lightningdesignsystem.com/utilities/themes/

To use this, set the input attribute

The default values is “slds-box slds-theme_default”

But not limited to these classes but you can also add other classes like padding, margin, grid, alignment, visibility, and custom CSS classes as well (especially if you’re using this screen component in Lightning Flow within a community)

Install here

From Aidan Harding: An expert Apex developer analyzes Flow vs. Apex tradeoffs and experiences

Thoughtful article here. Check it out.

Mass-Modify Record Type Visibility on Profiles and PermSets with SetupViaFlow

SetupViaFlow is a new installable extension that lets you define changes to Record Type Visibility in Profiles and Permission Sets. This is normally done here:

Assigning Record Types to ProfilesAssigning Record Types to Permission Sets

In real Salesforce usage, orgs can have a lot of these objects, and admins have been asking for some automation tools to make these changes in batches for a long time.

SetupViaFlow solves this nicely. Watch the video to learn more:

As you may be able to infer from the name, the hope here is that Record Type Visibility is just the start of the things that this app will automate in Setup. It has been built in a highly modular fashion, and it will be straightforward to add other kinds of Profile and Permission Set settings to this tool. In fact, we’re looking for help growing the range of Setup activities that can be done using this approach. If you have suggestions as to what we should prioritize to add to this, leave a comment below.

Also see the additional Developer Deep Dive video at the bottom of this post.

Considerations

This only works on custom profiles and permissions sets. But then, you don’t want to be playing around with the standard ones anyways.

This doesn’t support defaults on profiles for person accounts.

Install

Step 1:Before installing this component you need to have on your org the Flow Base Components support package, version 1.3.2 or greater.

Install that here.

Step 2 : Install the current version of SetupViaFlow
Install Version 1.0.0 Unlocked 9/27/20

Step 3 : If you don’t have one on your org, add a Remote Site Setting that points back to your own org. The easiest way to do this for a new org is to run the flow in Debug mode and wait for this error:

which conveniently gives you the exact form of the URL you need to create a simple Remote Site Setting in Setup:

Source

source

Developer Deep Dive

FlowBaseComponents 1.3: Now with QuickChoice and Dual List Box

We’ve added QuickChoice and DualListBox to FlowBaseComponents.

Another change: the size of fbc_MetadataService was reduced by converting spaces to tabs.

Install here.

New Flow Action that will show Governor Limits

The Get Limits component is designed to assist with exposing Salesforce governor limits within Flow via a simple unmanaged package.  In many instances in order to get to this data, you need to dig through your flow’s debug logs to determine there’s no potential issues.  This app allows you to easily surface that information within an action step right within your existing flow and then also take action on the outputs if necessary.

Find out more here.

Join the Multicolumn Screens Pilot

Enable this pilot to see a new component in Screen Builder: Section. Each section can be divided into up to 4 columns. Customers can use Sections to create multi-column layouts on their screens, and then embed whatever screen components they like in those components. 

To register for the pilot, you currently need to request access via your Account Executive. Join the pilot community here and learn more.

Now Display Rich Text and Custom Links and Images in Datatables

Thanks to a great addition from Kevin Hart (datapharmer), you can now display Rich Text, Images and Custom Links in your Datatables.

When you view a regular Listview with a Rich Text field, this is what you will see.

Here are the same records displayed in the Datatable component.  Notice the Rich Text, Images and Links.

The Datatable also supports Text Formula fields with Functions such as IMAGE and HYPERLINK.

Here’s an example of an IMAGE formula based on the value of the Type field.

Here’s how you can use Custom HYPERLINK Formula fields to display links that aren’t natively handled by the Datatable component.  This example adds custom fields to the Opportunity Lineitem object to display links to the related Opportunities and Products.

Best of all, you can create a Clickable Image using both the HYPERLINK and IMAGE Functions in the same Formula field.  

In the above example, clicking on any of the formula generated Logos in the first column of the Datatable will open a tab with the URL that is displayed in the Test URL column.