New Flow Content

Flow Builder Posts

Check out Arnab Bose’s post on the new Flow Builder. Arnab heads up product management for Lightning Flow. The new Flow Builder is part of this Platform press release, as well.

New Flow Solutions Category on App Exchange

A new Flow Solutions section has been added to the AppExchange.

This includes a range of new flow actions, components and solutions.

The New Page Components Section

  1. Eric Smith, who has added great value with his Lookup component improvements, has posted a couple of cool Page Components. These are designed to go not in flow screens but in Lightning pages. We’ve created a new section here. The new components include:

Field Update Button

This is a generic Lightning Component that can be used in place of a JavaScript button to set the value of a single field in a record. This is handy for using a button to trigger a Process Builder.

Quick Action Button

This is a generic Lightning Component that allows a Button to execute a Quick Action. The Button can be placed anywhere on a Lightning Record Page.

See the New Official Screen Components online on Tuesday at Release Readiness Live

Stimulated by demand and response from these unofficial community components, Salesforce has finished adding a new batch of official screen components to the upcoming Winter ’19 release. I’ll be demonstrating them at the Release Readiness Live Platform broadcast on Tuesday 9/18:


Almost all of this batch derives in some way from the unofficial community work and feedback that has been received. For example, the official Dependent Picklist component will support field dependencies in no small part due to this comment from last February:


Many of the other components being created are variations of the uber input component introduced here, created by Ryan McConnell:


So we’re establishing a pipeline where the best community components get incorporated into the official Salesforce product, and there’s more to come.

Component-building Session at Dreamforce

I’ll be hosting a brief session with Rakesh “Automation Champion” Gupta focusing on using and creating components, including some glimpses of official components that didn’t quite make the Winter ’19 deadline and will be coming in Spring ’19:


…and here’s the overall schedule of Flow-related sessions at Dreamforce:


Building Expressions in Strategy Crafter

Expressions are used in several NBA elements to determine at run-time which propositions should be allowed to flow through.

You can build expressions one of two ways:

  1. Formula Mode provides a text box into which you can enter any expression that the Salesforce formula engine is capable of processing.
  2. Builder Mode provides a point-and-click way to assemble an expression with a minimum of manual entry.

To understand expressions in NBA you need to understand the concept of context records. The context record for a particular execution of a strategy depends on where the execution request came from. If the request came from an NBA Component sitting on a Case record page, then the context record will be that particular Case. If the request comes from a self-serve Community portal page, the context record will be the User that’s logged in. When consumers of NBA recommendations send an execution request to the Strategy Engine, they provide a context record Id.

When you’re configuring an NBA strategy (sometimes referred to as “Config Mode” or “Design Time”), your design something that might get hundreds of different unique recordId’s passed into it. So you need a placeholder that will represent those different values. These placeholders are referred to as global resources and are expressed with a dollar sign. “$Record” is the placeholder representing the actual recordId that will be passed in at Run Time.

There are other global resources that you can use:

$User is the current user logged into the session that generated the execution request

$Request contains any arguments that were passed in with the execution request.

Expressing Field Values

You can span from a global resource to its fields like this:

$Record.mycustomerfield__c

Expressing Relationships

You can span across relationships up to 5 levels like this:

$Record.Contact.FirstName

Creating Expressions in Builder Mode

In Builder Mode, you can start an expression from any available global resource:


Understanding “Object Lock-In”

Consider the expression above ($Record.Contact.FirstName). This will work if the recordId passed in at run-time has a relationship to Contact, so you could use this expression in a strategy intended for generating recommendations for a Case page, because Case objects have a built-in relationship to Contact objects. The expression would resolve at runtime into Case.Contact.FirstName.

However, suppose you took that same strategy and called it from an NBA Component that had been placed on a Contact page? In that case the expression would attempt to resolve as Contact.Contact.FirstName. That doesn’t work because Contacts don’t have relationships to Contacts, so an error will be generated.

What this demonstrates is that most strategies are crafted to ‘fit’ a particular object-type. We refer to that as Object Lock-in. One of the most common sources of errors comes when someone attempts to use a Strategy from a page that isn’t a fit for that strategy’s expressions.

Using AutoComplete in Builder Mode

The Builder Mode of Strategy Crafter can provide you with a list of fields to choose from. However, Strategy Crafter can’t read your mind and doesn’t know from which record pages you intend to call this strategy. To give Strategy Crafter the necessary hint, you can use the “Autocomplete assumes incoming record…” drop-down to pick the object around which you want to design your strategy.


The value of this drop-down has no direct impact on your strategy. It only effects which fields will pop up in the expression builder when you start to create an expression.

If you change this setting on an existing strategy, it will not change any of the existing expressions.

July Flow Update

Disclaimer: Content and opinions are my own and not the views of my employer. The software discussed here is not official Salesforce software.

Some nice Flow-related posts from the community

Terrence Chiu with a great example that incorporates both the lightning:datatable component and record:editForm.

Part 1

Part 2

Rich Engelhard has a two-part post that also incorporates datatable and goes into fabulous detail.

Part 1

Part 2

More enhancements to the Lookup Component

Eric Smith has added “default” functionality: You can enter a default value for the input field (I2_Display Which Field). When provided, it will override any WhereClause and display the default value as Placeholder text in the input field. You will still need to select the drop-down then select the single value that is displayed. If you start to overtype the input field, the default value will be cleared and the WhereClause (if provided) will be reset and the field will act like a normal filtered lookup with search. Install the updated version here.

Salesforce Lightning Flow Extensions — June Update

Disclaimer: Content and opinions are my own and not the views of my employer. The software discussed here is not official Salesforce software.

  1. New Image component brings Images, Borders, CSS Styling, Padding, Margins and much more to Flow Screens

Watch the video

Read the Blog Post.

2. Lookup has been updated to fix some nasty bugs

Install the latest Lookup component here. You may need to first uninstall the existing one.

The New Image Flow Screen Component

Note: This is not an official Salesforce posting or an official piece of Salesforce technology.

Watch the video.

I will be the first to admit that it’s not like you couldn’t put an image in a flow screen before now. The techniques are out there, but the pathways have been, shall we say, convoluted. Here’s a message from 2012:

Got that? Or maybe do it this way:

Over this weekend, I decided to take advantage of Lightning Component technology and the new Lightning Navigation to make a new component that’s easy to deploy and provides access to serious css styling.

The result is a new component called imageFSC. Like other Flow Screen Components, it comes in a package that you install into your org, and you add it to regular Flow Screens that are either running in Lightning Experience or are in Visualforce pages in the Flow container component.

Here’s an example of a screen

Let’s take a look at how this is done.

Images are Static Resources

To start with, you have to identify the specific images you want, and upload them to your Salesforce org as Static Resources.

I find the term “Static Resources” somewhat off-putting, but this is really just a storage location where you can stick images and other data files.

The simplest implementation of an image is this:

As you can see, you only have to provide the imageFSC component with a single input value, the name of your Static Resource.

These images are pretty big, but you can use css directives to resize your images:

The configuration for that looks like this:

Note that I have to use px to specify that I’m talking about pixels. The documentation for this component is here, and it provides links to some of the source material for learning about what’s possible with each of these attributes. For image height and width, you can, for example, use any of these:

  • in: inches
  • cm: centimeters
  • mm: millimeters
  • pt: points — the points used by CSS are equal to 1/72nd of 1in.
  • pc: picas — 1pc is equal to 12pt.
  • px: pixel units — 1px is equal to 0.75pt.

Let’s talk about positioning. If I make my screen wide enough, you can see that these two images end up on the same line:

That’s because the imageFSC component uses span elements instead of div elements. This allows you to put images side by side. Suppose you don’t want to? let’s say that instead we want to center these images like this:

The configuration involves two steps. First we instruct the browser to treat an image like a block (something that runs the full length of the screen from right to left), and then we tell it to auto-center it:

The attribute styleDisplayAsBlock defaults to false but should be set true if you want centering behavior. Note that you can enter a full four margin configuration into styleMargin or configure the four margin values separately.

Improving Presentation: Thumbnails

You can create a thumbnail effect by setting border values as follows:

This results in a border that looks like this:

Resizing Images Proportionally

To resize images while maintaining their proportion, use a combination of “auto” width and height and specific max-width and max-height:

In this image, the two photographs use that approach:

Showing Images On The Same Line

You can also specify that images should use a percentage of the total width. Here, each of the bottom images has been given 50% of their block:

Here’s the configuration:

I don’t actually need to set styleDisplayAsBlock to false. The fine tuning of the image Height has allowed me to match up two images with different size.

Using Images as Navigation

You can also choose to allow people to click on your image and have something happen, just like regular web page images. There are basically three things you can do with this component when someone clicks on an image:

  1. Move the Flow (equivalent to clicking Next, Previous, or Finish)
  2. Load a Web URL into another tab (Lightning Experience only)
  3. Replace the flow with another Salesforce page (Lightning Experience only)

Here’s an example, where two imageFSC components are used to provide custom Next and Back buttons:

The configuration of these images is:

There’s more information about flow transitions in the navigationButton component writeup.

I’ll cover the details of flow navigation in a later blog post. For now, the documentation is available here.

Want to install this component? You can do so here.

Transitioning Spring ’18 Local Actions to Summer ’18

This Pilot Update is for Salesforce customers participating in the Spring ’18 pilot for Flow Local Actions.

Local Actions that run on Spring ’18 orgs are not compatible with Summer ’18. Summer ’18 versions of the sample actions made available as part of the pilot are available on this site and will need to be installed when your org running Local Actions is upgraded to Summer ’18.

You may need to remove the old Local Action from any flows in which you’ve installed it. (If you are getting an error message Error parsing file: 'localAction' is not a valid value for the enum 'InvocableActionType' then you have a flow that still has a saved reference to the old version. See “InvocableActionType Change”, below.

For Developers of Local Actions

If you have created Local Actions using the Spring ’18 pilot, you will want to be aware of the following:

Existing Local Actions require the following changes to work with Summer ’18:

  1. The marker interface has changed from flowruntime:availableForLocalInvocableActions to lightning:availableForFlowActions. This change is made in the “cmp” file of your lightning component file set.
  2. The “callback” mechanism has been removed. Both of these lines, which will exist in Spring ’18 local actions, must be removed to work on Summer ’18. If you wish to pass success vs. failure information at the end of your local action, you can do it one of two ways:
    1. create a variable and set its value, and then have the flow subsequently decision on that value
    2. use the recommended async approach, involving Promises (see the release notes and developer guide documentation, available soon).

Other transition notes:

We encourage builders of Local Actions to use promises. An example of that is available in the release notes for Summer ’18. An example of the recommended form is shown below.

InvocableActionType Change. If you have created flows that use local actions, InvocableAction enum in the Metadata API, the enum value for a local action has changed from “localAction” to “component”. One place this manifests if if you have extracted metadata for a flow that had a local action. The file will have a section that looks like this:

<actionCalls>
 <name>Success</name>
 <label>Success</label>
 <locationX>595</locationX>
 <locationY>431</locationY>
 <actionName>c:showToast</actionName>
 <actionType>localAction</actionType> 

In cases like this change “localAction” to “component” to avoid the error message:

Error parsing file: 'localAction' is not a valid value for the enum 'InvocableActionType'

Recommended Form for Invoke Methods as of Summer ’18

 invoke : function(component, event, helper) {
           var args = event.getParam("arguments");


           return new Promise(function(resolve, reject) {
               var xhttp = new XMLHttpRequest();
               xhttp.onreadystatechange = $A.getCallback(function() {
                   if (this.readyState === 4) { // DONE
                        if (this.status >= 200 && this.status < 300) {
                            var response = JSON.parse(xhttp.responseText);
                                component.set("v.churnVal", response);
                                resolve();
                        } else {
                            var errorText = "";
                            if (this.status === 0) {
                                errorText = 'Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.';
                            } else {
                                errorText = this.statusText;
                            }
                                reject(new Error(errorText));
                        }
                    }
               });
               var customerId = component.get("v.customerId");
               xhttp.open("GET", "https://upp57qbj5b.execute-api.us-west-1.amazonaws.com/production/customer/"+customerId+"/churn", true);
               xhttp.send(null);
           });    
        } 

Strategy Crafter: Introduction

Overview
Strategy Crafter is a lightweight graphical tool for editing and managing Recommendation Strategies for Einstein Next Best Action. It is not an official Salesforce application. It was built by some members of the community. The real Strategy Builder will be delivered as part of later releases of Einstein Next Best Action. In the meantime, though, the Crafter can simplify the work to build and maintain Strategies.


Understanding the Strategy Pipeline

The Strategy is a new Salesforce element that lies at the heart of creating great recommendations. Information about Strategies is available in the official Salesforce pilot documentation, so these tool docs will assume you know about them.

Automatic Saving
Changes to strategies are automatically saved in the background and all strategies are implicitly ‘Active’ just like all changes to Salesforce records immediately take effect. There is no automatic versioning (as there is in Lightning Flow). You may want to use the Duplicate Strategy menu items to create copies. There’s also When you click Save in the Crafter, it deploys an XML metadata version of the current strategy to your org, overwriting any version that’s there.

Export and Import
Under the covers, the main purpose of this tool is to help you generate the complex XML documents that drive Salesforce. You can export and import these easily from the menu.
 
 Strategy Crafter ONLY WORKS WITH SUMMER ’18 ORGS.

Installation

Using Strategy Crafter

After installing, you should find a Strategy Crafter tab in the App Launcher. Select it to load the Strategy Crafter.


Loading a Strategy
 When you first install, you will probably not have any saved Strategies, so you should either create a New one from scratch or use the Import from XML menu item to paste an existing one in as XML. Here are some sample xml files in 214 XML format
 
 
 Activating/Publishing a Strategy
 Saving a Strategy deploys and activates it. Once you save a Strategy you should be able to configure the Next Best Action lightning component by providing the name of the Strategy, and it should start to produce Propositions.

Learn More: Tutorial 1

Reporting Issues

  1. Email them here for now.

Strategy Crafter Home

moved here.

moved