You are on page 1of 82

Salesforce.

com: Summer '12

Visual Workflow Implementation Guide

Last updated: June 2 2012


Copyright 20002012 salesforce.com, inc. All rights reserved. Salesforce.com is a registered trademark of salesforce.com, inc., as are other

names and marks. Other marks appearing herein may be trademarks of their respective owners.

Table of Contents

Table of Contents
Chapter 1: About Visual Workflow.......................................................................................................3
Chapter 2: About the Flow Designer.....................................................................................................4
What's Supported in the Cloud Flow Designer........................................................................................................................5
Understanding the Flow Designer User Interface.....................................................................................................................8
Creating a Flow.......................................................................................................................................................................10
About Saving a Flow...............................................................................................................................................................10

Chapter 3: Flow Designer Elements....................................................................................................12


Managing Flow Designer Elements........................................................................................................................................13
Adding and Configuring a Step Element................................................................................................................................13
Adding and Configuring a Screen Element............................................................................................................................14
Configuring the Screen Element's General Info Tab..................................................................................................14
About the Screen Element's Add A Field Tab............................................................................................................15
Configuring the Screen Element's Field Settings Tab................................................................................................15
Configuring User Input Fields on the Screen Element's Field Settings Tab...............................................................16
Configuring Choice Fields on the Screen Element's Field Settings Tab....................................................................17
Configuring Output Fields on the Screen Element's Field Settings Tab....................................................................18
Adding and Configuring a Decision Element.........................................................................................................................19
Adding and Configuring a Record Lookup Element..............................................................................................................20
Adding and Configuring a Record Create Element................................................................................................................22
Adding and Configuring a Record Update Element...............................................................................................................23
Adding and Configuring a Record Delete Element................................................................................................................24
About Subflows.......................................................................................................................................................................25
Adding and Configuring a Subflow Element..........................................................................................................................25
Viewing Inputs and Outputs of Other Referenced Flow Versions..............................................................................27
Adding and Configuring an Apex Plug-in Element...............................................................................................................28
About Apex Plug-ins in Flows....................................................................................................................................29
Adding and Configuring an Assignment Element..................................................................................................................30
About the Connector Element................................................................................................................................................30
About the Fault Connector.........................................................................................................................................31

Chapter 4: Flow Designer Resources...................................................................................................33


Adding and Configuring a Constant.......................................................................................................................................34
Adding and Configuring a Variable........................................................................................................................................34
Adding and Configuring a Formula........................................................................................................................................36
About Formulas in Flows............................................................................................................................................36
Adding and Configuring a Text Template..............................................................................................................................37
Adding and Configuring a Choice..........................................................................................................................................38
Adding and Configuring a Dynamic Choice...........................................................................................................................39
About Global Constants in the Cloud Flow Designer............................................................................................................41

Table of Contents

Chapter 5: Flow Administration..........................................................................................................43


Managing Your Flows.............................................................................................................................................................44
Editing Flow Properties..........................................................................................................................................................46
Putting Flows to Work............................................................................................................................................................47
Adding a Flow to a Visualforce Page......................................................................................................................................48
Setting Flow Finish Behavior..................................................................................................................................................49

Chapter 6: Running Flows..................................................................................................................51


Chapter 7: Flows in Change Sets and Packages....................................................................................52
Chapter 8: Flow Limits.......................................................................................................................54
Chapter 9: Visual Workflow Considerations........................................................................................55
Chapter 10: Visual Workflow Accessibility Overview...........................................................................57
Chapter 11: Visual Workflow Terminology.........................................................................................58
Appendices........................................................................................................................................59
Appendix A: Tutorial #1: Creating a Tip Calculator....................................................................59
Optional Step: Pre-configure Your Flow Using Step Elements..................................................................................59
Step 1: Add a Screen Element to Capture the Bill Information..................................................................................60
Step 2: Create Formulas to Calculate Tip Amount and Total Bill..............................................................................61
Step 3: Add a Screen to Display the Results................................................................................................................63
Step 4: Save the Flow..................................................................................................................................................65
Step 5: Run the Flow...................................................................................................................................................65

Appendix B: Tutorial #2: Creating a Sustainability Survey...........................................................67


Step 1: Add a Screen Element to Capture Users Region............................................................................................67
Step 2: Add and Configure a Decision Element.........................................................................................................68
Step 3: Add a Screen Element for the AMERICAS Option......................................................................................69
Step 4: Add a Screen Element for the EMEA Option...............................................................................................71
Step 5: Collect Commute Information........................................................................................................................73
Step 6: Collect Email Address.....................................................................................................................................74
Step 7: Thank the Respondents...................................................................................................................................75
Step 8: Save the Flow..................................................................................................................................................76
Step 9: Run the Flow...................................................................................................................................................77

Index.................................................................................................................................................79

ii

Chapter 1
About Visual Workflow
Available in: Enterprise, Unlimited, and Developer Editions

Visual Workflow allows administrators to build applications, known as flows, that step users through screens for collecting and
updating data. For example, you can use Visual Workflow to script calls for a customer support center or to generate real-time
quotes for a sales organization.
Visual Workflow has three different aspects: flow design, flow management, and runtime. As an administrator, you create the
flows using the Flow Designer, which has a drag-and-drop user interface that lets you diagram flow structure and configure
how it runs, without writing any code. Once you create a flow, you can manage it in Salesforce, edit its properties, activate,
deactivate, delete, or run it at will. Flow users can then run the activated flow from a custom button, tab, link, or directly from
the flow URL.

Chapter 2
About the Flow Designer
In this chapter ...

What's Supported in the Cloud Flow


Designer
Understanding the Flow Designer
User Interface
Creating a Flow
About Saving a Flow

Watch a Demo (2:27 minutes)


The Flow Designer, the tool for creating flows, lets you configure screens and
define branching logic for your flows without writing any code.
Elements are the building blocks of flows. Each element represents an action,
such as presenting information to, or collecting information from, flow users, or
even querying, creating, updating, and deleting information in Salesforce. By
connecting elements together in the Flow Designer, you can create a flow, which
is a series of screens, inputs, and outputs through which users navigate.
Salesforce supports two versions of the Flow Designer:

The Cloud Flow Designer is native to Salesforce. With it, you can create new
flows and manage their content directly from the flow list and detail pages.
The legacy desktop version of the Flow Designer is a standalone application
which you can download from the flow list page and install on your computer.
Flows created with this designer are saved as files which you then upload into
Salesforce. For more information about how the desktop Flow Designer
works, see the desktop Flow Designer user guide.
Important: You may install and use the legacy desktop version of the
Flow Designer for Visual Workflow (the Legacy Flow Designer)
during your subscription term. The Legacy Flow Designer software is
delivered along with the software programs listed in the Supplemental
Terms and Conditions for Salesforce Visual Workflow. Those software
programs are licensed to you under the license terms referenced in those
Supplemental Terms and Conditions and are not deemed part of the
Services for purposes of your Master Subscription Agreement.

System Requirements
To use the Cloud Flow Designer, we recommend:

Windows Internet Explorer versions 8 and 9, Google Chrome, or


Mozilla Firefox. Internet Explorer 6 is not supported.
Adobe Flash Player version 10.1 and later. The minimum version required
to run the Cloud Flow Designer is 10.0.
A minimum browser resolution of 1024x768.
Note: Due to a Firefox/Adobe version compatibility issue, the Cloud
Flow Designer might not work correctly if youre running Flash Player
11 in Firefox 3.6.

About the Flow Designer

What's Supported in the Cloud Flow Designer

What's Supported in the Cloud Flow Designer


If you've previously used the desktop version of the Flow Designer, note that some features and elements have changed in the
new Cloud Flow Designer. Some elements were renamed, some were consolidated, and others aren't supported. These tables
illustrate the differences in elements and feature support between the desktop and the Cloud Flow Designer.

Supported Elements
Elements

Desktop
Flow
Designer

Cloud Flow
Designer

Comments

Allocator

Y changed

Known as Assignment in the Cloud Flow Designer.

Apex Plug-in

Choice

Y changed

Part of the Screen element in the Cloud Flow Designer.

Choice Lookup

Y not for
forms

Known as Dynamic Choice in the Cloud Flow Designer. Forms,


choices, and Dynamic Choice are incorporated into the Screen
element.

Constant

Data Lookup

Data Source

Data Target

Data Update

Decision

Dynamic Choice

Email

Flare

Y changed

Flow Summary

Form

Y changed

Part of the Screen element in the Cloud Flow Designer.

Formula

The Formula element in the Cloud Flow Designer uses the


standard Salesforce formula engine.

Lead Convert

Non-visual start elements Y

Question

Y changed

Part of the Screen element in the Cloud Flow Designer.

Question/Choice Prompt Y

Y changed

In the desktop designer, it's a prompt. Part of the Screen element


in the Cloud Flow Designer as the Choice field label.

Record Create

Known as Record Lookup in the Cloud Flow Designer.

Known as Record Update in the Cloud Flow Designer.

Replaces the Choice Lookup element from the desktop Flow


Designer.

Known as Step in the Cloud Flow Designer. Not valid for active
flows.

About the Flow Designer

What's Supported in the Cloud Flow Designer

Elements

Desktop
Flow
Designer

Cloud Flow
Designer

Comments

Record Lookup

Replaces the Data Lookup element from the desktop Flow


Designer.

Record Update

Replaces the Data Update element from the desktop Flow


Designer.

Record Delete

Resource

Y changed

Known as Text Template in the Cloud Flow Designer

Screen

Represents a whole flow screen in the Cloud Flow Designer.


Combines functionality from the desktop designer's Form,
Question, Choice, and Statement elements.

Statement

Y changed

Part of the Screen element in the Cloud Flow Designer as the


Display Text field on the Add a Field tab.

Step

Replaces the Flare element from the desktop Flow Designer. A


flow with a Step can't be activated.

Subflow

Text Template

Valuetable

Variable

Replaces the Resource element from the desktop Flow Designer.

Supported Functionality
Functionality

Desktop
Flow
Designer

Cloud Flow
Designer

Comments

Clear User View

No support for simulator in the Cloud Flow Designer.

Close

Convert

Y (limited)

Copy Element

Cut

Delete Element

Not in button bar, but mouse over element in the Cloud Flow
Designer and either click or press DELETE.

Dependencies for
Elements

Available in the Cloud Flow Designer on the Usage tab in the


Description pane.

Export flow

Flow Summary

Flow Spec

In the Cloud Flow Designer, the only conversion allowed is from


Step to Screen.

About the Flow Designer

What's Supported in the Cloud Flow Designer

Functionality

Desktop
Flow
Designer

Cloud Flow
Designer

Grouping elements

Help

Insert Default Element

Merge Fields in default


value for user input

Merge Fields in display


text

Open multiple flows in


tabs

Open Recent

Organize Layout Tree Y


map

Paste

Procedure

New

Redo

Refresh

Run

Save/Save As

Select All

Send Email

Set Default Element

Set as Start Element

Setting follow
highlightpath when
running

Setting show element Y


explorer

Setting Summary on
hover

SFDC settings

Undo

Validate

Comments

Desktop has a PDF. The Cloud Flow Designer has online help.

You can't open multiple flows in the Cloud Flow Designer.

In the Cloud Flow Designer, click and drag a box around


elements on the canvas to select them.

No Flow Simulator with the Cloud Flow Designer.

Not needed anymore with the Cloud Flow Designer.

About the Flow Designer

Functionality

Understanding the Flow Designer User Interface

Desktop
Flow
Designer

Watch Interview Flow Y


Simulator

Cloud Flow
Designer

Comments

Understanding the Flow Designer User Interface


Visual Workflow allows administrators to build applications, known as flows, that step users through screens for collecting
and updating data. For example, you can use Visual Workflow to script calls for a customer support center or to generate
real-time quotes for a sales organization.
The Flow Designer user interface has several functional areas.

About the Flow Designer

Understanding the Flow Designer User Interface

Button Bar (1)


Use the buttons in the button bar to save, close, undo or redo changes to, run, or view properties of your flow. The status
indicator on the right side of the bar shows whether your flow is active or inactive, saved or unsaved, and whether you got any
warnings or errors upon saving. You can click the notification of warnings or errors to see all of them in a list. Warnings and
errors in the list are based on the state of the flow at your last save, not the present state of the flow.
Save and Save As
Depending on your needs, you can quick-save, save a new flow, or save a new flow version. To find out more about how
save works, see About Saving a Flow on page 10.
Run
Runs the most recent save of the flow youre working in. If the flow contains subflow elements, each subflow runs the
active version of its referenced flow. If the referenced flow has no active version, then the subflow element runs the latest
version of its referenced flow.
Run with Latest
Only appears if the open flow contains a subflow element. Runs the most recent save of the flow youre working in, and
each subflow element runs the latest version of its referenced flow, even if that version is not active.
Close
Clicking Close from within an unsaved flow returns you to the flow list page. Clicking Close from within a saved flow
returns you to the flow detail page.
Undo (
) and Redo (
)
Undo or redo recent actions on the main canvas.
Copy (
) and Paste (
)
Copy and paste selected elements on the main canvas. Click to select a single element, or click and drag to select multiple
elements on the canvas. Once youve selected what you want to copy, click Copy (
can undo or redo a paste action, but not a copy.

), and then click Paste (

). You

Note: When you copy and paste an element, the new copy has the unique name of the original, appended with
_x, where x is a number. The first copy of an element has _0 appended to its unique name, and the number
increments from there with subsequent copies of the same element.

Flow Properties (
)
Shows you information about your flow, such as its name, unique name, description, version, and created and modified
dates. You can edit the name and description of your flow any time, but you can only change its unique name when
saving it for the first time.

Main Canvas (2)


To move an element, drag it around the canvas. If the element is connected to a line, the line moves with it. You can connect
items on the canvas by clicking the node beneath the source element and dragging and dropping a line anywhere onto a target
element. To select multiple elements, either drag a square around a group or use control-click to select individual elements.
Double-click any element in the main canvas to edit it.

About the Flow Designer

Creating a Flow

Explorer Tab (3)


The Explorer tab is a library of all elements and resources added to the flow. Double-click items in the list to edit them.
Single-click an item to view its details and usage in the Description pane.

Resources Tab (4)


The Resources tab lets you create new resources for your flow, like variables and constants. Once created, your new resources
show up in the Explorer tab.

Palette Tab (5)


The Palette tab lists all the element types available for your flow. Drag and drop elements from the palette onto the main
canvas. Click an element in the palette to see its description or properties in the Description pane. Once created, your new
elements show up in the Explorer tab.

Description Pane (6)


When viewing an item in the Palette or Resources tab, the Description pane shows the items description or details. When
viewing items on the Explorer tab, the Description pane includes two subtabs: Properties and Usage. The Properties subtab
shows you information about the element or resource you have selected, such as its label, unique name, description, and data
type. The Usage subtab shows you where the selected item is being used.

Creating a Flow
User Permissions Needed
To open, edit, or create a flow in the Cloud Flow Designer

Manage Force.com Flow

To create a flow in the Cloud Flow Designer, go to Your Name > Setup > Create > Workflow & Approvals > Flows and
click New Flow.

Tips and Tricks for Creating Flows

Have a draft flow in mind before you start creating your flow in the Cloud Flow Designer.
If you're not sure what kind of element you need for a node in your flow, use a Step element as a placeholder until you
figure it out. You can always replace it later.
If you need to delete a group of elements and connectors, you can left-click and drag to select an area containing them.
Then press DELETE to remove all of them at once.

If you're new to the Cloud Flow Designer, we recommend walking through one or more of the sample flow tutorials in the
Visual Workflow Implementation Guide. They're a great way to introduce yourself to the tool and discover how things work.

About Saving a Flow


After you've created a flow in the Cloud Flow Designer, you have a few options for saving it:

10

About the Flow Designer

About Saving a Flow

Initial saveWhen you save a new flow for the first time, a dialog box appears. Enter a flow name, unique name and
description. Once you save the flow, the unique name can't be changed.
Note: A unique name is limited to underscores and alphanumeric characters. It must be unique, begin with a
letter, not include spaces, not end with an underscore, and not contain two consecutive underscores.

Quick saveAfter you've saved a flow once, the Save button works as a quick-save, overwriting your previous work.
However, the Save button doesnt work when editing active flows. You must use Save As to save your changes as a new
version or new flow.
Save AsOnce you've saved your flow for the first time, this button is enabled, with two options:
Save as new flow opens a dialog box where you can input a new name, unique name and description, then save your
changes as an entirely new flow.
Save as new version saves the flow you're working on as a new version of the current flow. This is a useful option if
you want to make changes to a flow and keep the old configuration as a backup in case you need to refer back to it later.
Each flow can have up to 10 versions. You can update the flow name and description when you save a new version, but
not the unique name.

When saving a flow or flow version:

If you have the flow detail page open in one browser tab, then open a flow version in a new browser tab to edit it, after
saving and closing it, you must refresh the first flow detail page before you can successfully run the flow version you just
edited.
If you've changed the flow properties and for some reason the save fails, the flow properties don't revert to the previous
values.

11

Chapter 3
Flow Designer Elements
In this chapter ...

Managing Flow Designer Elements


Adding and Configuring a Step
Element
Adding and Configuring a Screen
Element
Adding and Configuring a Decision
Element
Adding and Configuring a Record
Lookup Element
Adding and Configuring a Record
Create Element
Adding and Configuring a Record
Update Element
Adding and Configuring a Record
Delete Element
About Subflows
Adding and Configuring a Subflow
Element
Adding and Configuring an Apex
Plug-in Element
Adding and Configuring an
Assignment Element
About the Connector Element

Available in: Enterprise, Unlimited, and Developer Editions

Elements are the building blocks of flows. Each element represents an action,
such as presenting information to, or collecting information from, flow users, or
even querying, creating, updating, and deleting information in Salesforce. By
connecting elements together in the Flow Designer, you can create a flow, which
is a series of screens, inputs, and outputs through which users navigate.
The following elements are available in the Cloud Flow Designer:

Step
Screen
Decision
Assignment
Record Create
Record Update
Record Lookup
Record Delete
Subflows
Apex Plug-In
Connector
Note: Every time you add an element or resource to a flow, it's also
added to the Explorer Tab.

12

Flow Designer Elements

Managing Flow Designer Elements

Managing Flow Designer Elements


User Permissions Needed
To open, edit, or create a flow in the Cloud Flow Designer

Manage Force.com Flow

Adding, Editing, and Removing Elements


To add an element to the Designer main canvas, drag and drop it from the Palette in the left sidebar. To edit an element,
double-click it in the main canvas, or hover your mouse over it and click . To remove an element, hover your mouse over it
and click . Alternately, you can remove elements and connectors by selecting them and hitting the DELETE key.

Setting a Start Element


To set the starting element in your flow, hover your mouse over an element on the canvas and click . You can set any one
element on the canvas as the starting element. If you don't set a start element, you get a warning after saving your flow.

Adding and Configuring a Step Element


User Permissions Needed
To open, edit, or create a flow in the Cloud Flow Designer

Manage Force.com Flow

Use the Step element as a placeholder when you're not sure what kind of element you need. Using Step elements, you can
sketch out a draft of any new flow or make conceptual changes to an existing flow.
To add or edit a Step element in the Flow Designer:
1.
2.
3.
4.
5.

Go to Your Name > Setup > Create > Workflow & Approvals > Flows and open a new or existing flow.
From the Palette, drag the Step element into the main area of the canvas.
Enter a name for the Step.
If you havent already added a description, click Add Description to do so.
Click OK to accept your changes or Cancel to discard them.

Steps aren't valid elements for active flows. You can have a draft flow with Steps in it and can run it in the draft state as an
administrator, but you must replace the Steps with other elements before you can activate the flow and let users run it.

Converting a Step into a Screen


You can convert a Step into a Screen element at any time by hovering your mouse over it and clicking

Things to note about converting Step elements:

Upon conversion, a Step's incoming connectors are preserved, but any outgoing connectors assigned to it are deleted.
After conversion, you can no longer use the Step's original unique name.

13

Flow Designer Elements

Adding and Configuring a Screen Element

Adding and Configuring a Screen Element


User Permissions Needed
To open, edit, or create a flow in the Cloud Flow Designer

Manage Force.com Flow

The Screen element can be used to set up a form to capture user input, provide choice selections, and display information to
your users. It combines functionality from several different elements in the desktop Flow Designer, such as Form, Statement,
Choice, and Question.
1.
2.
3.
4.

Go to Your Name > Setup > Create > Workflow & Approvals > Flows and open a new or existing flow.
From the Palette tab, drag the Screen element onto the canvas.
Set up your Screen by configuring fields on the General Info, Add a Field, and Field Settings tabs.
Click OK to accept your changes or Cancel to discard them.
Note: Every time you add an element or resource to a flow, it's also added to the Explorer Tab.

As you progress through the Screen overlay, you can see a preview of what you're building in the right pane.

Configuring the Screen Element's General Info Tab


User Permissions Needed
To open, edit, or create a flow in the Cloud Flow Designer

Manage Force.com Flow

The Screen element overlay in the Flow Designer has three tabs: General Info, Add a Field, and Field Settings. To configure
the General Info tab:
1. Enter a Screen Name, then press TAB. The Unique Name field should auto-populate.
2. You can enter a different unique name for the screen.
Note: The requirement for uniqueness applies only to elements within the current flow. You can have two elements
with the same unique name, provided they are used in different flows. A unique name is limited to underscores
and alphanumeric characters. It must be unique, begin with a letter, not include spaces, not end with an underscore,
and not contain two consecutive underscores.
3. If you havent already added a description, click Add Description to do so.
4. To provide flow users with help for the screen:
a. Click the arrow to expand the Help Text section.
b. Enter the text that you want flow users to see when they click Help for this form.
c. Click to switch between the plain text editor and the rich text editor.
If you use the rich text editor, the content is saved as HTML.

14

Flow Designer Elements

About the Screen Element's Add A Field Tab

About the Screen Element's Add A Field Tab


The Screen element overlay in the Flow Designer has three tabs: General Info, Add a Field, and Field Settings.
The Add a Field tab lists all the available fields you can add to your Screen.

Inputs

Textbox
Long Text Area
Number
Currency
Date
Password

Choices
Radio Buttons
Drop-down List

Outputs
Display Text

Add an input, output, or choice field to a Screen either by double-clicking or dragging it to the preview pane. Remove a field
from the Screen overlay by hovering over it and clicking
them up and down.

. Reorder the fields in the preview pane by clicking and dragging

Configuring the Screen Element's Field Settings Tab


User Permissions Needed
To open, edit, or create a flow in the Cloud Flow Designer

Manage Force.com Flow

The Screen element overlay in the Flow Designer has three tabs: General Info, Add a Field, and Field Settings.
On the Field Settings tab, configure the field you've added to the form by clicking it in the right-hand preview pane of the
overlay. The options available on the Field Settings tab vary based on which type of field you're configuring.

Inputstextbox, long text area, number, currency, date, password


Choicesradio buttons, drop-down list
Outputsdisplay text

15

Flow Designer Elements

Configuring User Input Fields on the Screen Element's Field Settings Tab

Configuring User Input Fields on the Screen Element's Field Settings Tab
User Permissions Needed
To open, edit, or create a flow in the Cloud Flow Designer

Manage Force.com Flow

The Screen element overlay in the Flow Designer has three tabs: General Info, Add a Field, and Field Settings.
On the Field Settings tab, configure the field you've added to the form by clicking it in the right-hand preview pane of the
overlay. The options available on the Field Settings tab vary based on which type of field you're configuring. Heres how to
set up user input fields on a Screen overlay, including textbox, long text area, number, currency, date, and password.
1. In the Screen overlays preview pane, click an input field to configure its settings.
2. In the General Info section, enter a Label to display text to the left of the field.
3. If you want to use the rich text editor to format your field label, click the rich text editor icon ( ) to the right of the Label
field.
a. Once youre done editing the text, click OK. The Label field display changes to indicate that it is now a rich text field.

b. Click Edit to make changes to your label text.


c. Click Clear to completely clear the Label field and start over.
4. You can enter a different Unique Name for your field. By default, this field is filled in with your field label.
Note: A unique name is limited to underscores and alphanumeric characters. It must be unique, begin with a
letter, not include spaces, not end with an underscore, and not contain two consecutive underscores.
5. Enter a Default Value to show a default value as ghost text in the input field. You can select values from existing screen
choice fields or flow resources, or you can create a new resource with which to populate the field.
6. For number and currency fields, you can set a Scale value. The scale is the maximum number of digits allowed to the
right of the decimal point. This number can't exceed 17. If you leave this field blank or set to zero, only whole numbers
are displayed when your flow runs.
7. Select the Required checkbox to make the field required.
8. In the Input Validation section, create a formula expression to validate the user input for the field.
a. Select Validate.
b. Enter a formula expression to define the values allowed for the field.
c. Customize the error message that will be displayed to the flow user if the input fails validation.
Click to switch between the plain text editor and the rich text editor. If you use the rich text editor, the content is
saved as HTML.
Note:

If the formula statement evaluates to TRUE, the input is valid. If the formula statement evaluates to FALSE, the
error message is displayed to the user.
If the user leaves the field blank, and the field is not required, no validation is performed.

16

Flow Designer Elements

Configuring Choice Fields on the Screen Element's Field Settings Tab

9. To provide flow users with help for the field:


a. Click the arrow to expand the Help Text section.
b. Enter the text that you want flow users to see when they click next to the field.
c. Click to switch between the plain text editor and the rich text editor.
If you use the rich text editor, the content is saved as HTML.
10. Click OK.

Configuring Choice Fields on the Screen Element's Field Settings Tab


User Permissions Needed
To open, edit, or create a flow in the Cloud Flow Designer

Manage Force.com Flow

The Screen element overlay in the Flow Designer has three tabs: General Info, Add a Field, and Field Settings.
On the Field Settings tab, configure the field you've added to the form by clicking it in the right-hand preview pane of the
overlay. The options available on the Field Settings tab vary based on which type of field you're configuring. Heres how to
set up choice fields on a Screen overlay, including radio buttons and drop-down lists.
1. In the Screen overlays preview pane, click a choice type field to configure its settings.
2. In the General Info section, enter a Label to display text to the left of the field.
3. If you want to use the rich text editor to format your field label, click the rich text editor icon ( ) to the right of the Label
field.
a. Once youre done editing the text, click OK. The Label field display changes to indicate that it is now a rich text field.

b. Click Edit to make changes to your label text.


c. Click Clear to completely clear the Label field and start over.
4. You can enter a different Unique Name for your field if necessary. By default, this field is filled in with your field label.
Note: A unique name is limited to underscores and alphanumeric characters. It must be unique, begin with a
letter, not include spaces, not end with an underscore, and not contain two consecutive underscores.
5. Optionally, change the Value DataType.
6. Select the Required checkbox to make the field required.
7. Use the Default Value field after youve created all your choice options in the Choice Settings section to set one to be
to pre-selected by default.
8. Use the Choice Settings section to configure the choice options.
a. Click the arrow button on the Choice field to create a new choice option or select an existing one.
b. To create a new choice, select CREATE NEW > Choice. See Adding and Configuring a Choice on page 38.

17

Flow Designer Elements

Configuring Output Fields on the Screen Element's Field Settings Tab

c. To create a new dynamic choice, select CREATE NEW > Dynamic Choice. Use a dynamic choice to create a lookup
to automatically populate the choice options during runtime. See Adding and Configuring a Dynamic Choice on page
39.
d. Click Add Choice to add another choice option.
e. Click

to remove a choice.

Note: Once created, the only way you can edit a choice or dynamic choice is by double-clicking it from the Explorer
tab.
9. To provide flow users with help for the field:
a. Click the arrow to expand the Help Text section.
b. Enter the text that you want flow users to see when they click next to the field.
c. Click to switch between the plain text editor and the rich text editor.
If you use the rich text editor, the content is saved as HTML.
10. Click OK.
Note: You can't rearrange choice list items.

Configuring Output Fields on the Screen Element's Field Settings Tab


User Permissions Needed
To open, edit, or create a flow in the Cloud Flow Designer

Manage Force.com Flow

The Screen element overlay in the Flow Designer has three tabs: General Info, Add a Field, and Field Settings.
On the Field Settings tab, configure the field you've added to the form by clicking it in the right-hand preview pane of the
overlay. The options available on the Field Settings tab vary based on which type of field you're configuring. Heres how to
set up a Display Text field on a Screen overlay.
1. In the Screen overlays preview pane, click the Display Text field to configure its settings.
2. Enter a Unique Name. A unique name is limited to underscores and alphanumeric characters. It must be unique, begin
with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores.
3. Enter the text you want to display to the flow user. For example, you could use a display text field to show flow users a
welcome message, a terms and conditions statement, or a description of a product or service.
Click to switch between the plain text editor and the rich text editor. If you use the rich text editor, the content is saved
as HTML.
4. Click OK.

18

Flow Designer Elements

Adding and Configuring a Decision Element

Adding and Configuring a Decision Element


User Permissions Needed
To open, edit, or create a flow in the Cloud Flow Designer

Manage Force.com Flow

Use the Decision element to evaluate a set of conditions and route users through the flow based on the outcomes of those
conditions.
You can use a Decision element to drive your flow without explicit end-user input. For example:

In a customer self-help portal, a Decision element could determine whether a customer is given a return shipping address
and information (because an item is definitely faulty), or given information on how to resolve their problem themselves.
Within a banking flow, a Decision element could determine if a customer should be offered a loan or not (based on results
of a credit scoring formula).
Tip: If you ask a user to make a choice in a screen with a drop-down list or radio buttons, hook up a Decision element
directly after the Screen element to create the branches of the flow based on the choices. You should represent each
drop-down list or radio button option in your Decision element and connect it to a branch of your flow.

To add or configure a Decision element:


1. Go to Your Name > Setup > Create > Workflow & Approvals > Flows and open a new or existing flow.
2. From the Palette, drag the Decision element onto the canvas.
3. Enter a Name and Unique Name for the Decision.
The requirement for uniqueness applies only to elements within the current flow. You can have two elements with the
same unique name, provided they are used in different flows. A unique name is limited to underscores and alphanumeric
characters. It must be unique, begin with a letter, not include spaces, not end with an underscore, and not contain two
consecutive underscores.
4. If you havent already added a description, click Add Description to do so.
5. Create the outcomes for the decision:
a. Enter a Name and Unique Name for the first outcome.
b. Set up the conditions for the outcome. You can expand the CREATE NEW section of the Resource or Value
drop-down list to create new resources, if necessary.
Note: Two operators are unique to the Cloud Flow Designer. Depending on the type of Resource you select,
you might see these in the Operator list:

was selectedAvailable only for choices. Lets you track whether a specific choice on a screen was selected
by the user. To learn more about how was selected works, see Visual Workflow Considerations on page
55.
was visitedAvailable for any main canvas element. Lets you track whether an element in the flow was
visited by the user.

Selecting either of these operators makes the Value of the condition statement Boolean. You can then set the
Value to true or false by clicking the arrow button, expanding the GLOBAL CONSTANT section, and
selecting either $GlobalConstant.True or $GlobalConstant.False. For more information, see About
Global Constants in the Cloud Flow Designer on page 41.

19

Flow Designer Elements

Adding and Configuring a Record Lookup Element

c. Click Add Condition to add another condition or click to remove a condition. At runtime, the conditions are
evaluated in the order you specify.
d. Choose under which conditions the outcome evaluates to true:

All conditions must be true (AND)The outcome will evaluate to true overall if all the conditions you specified
evaluate to true.
One condition must be true (OR)The outcome will evaluate to true overall if at least one of the conditions
you specified evaluates to true.

6. Click Add Outcome to add more outcomes. You can drag outcomes up and down to reorder them.
7. Click [Default Outcome] to set up a path to which users will be routed if none of the other outcome conditions are met.
8. Click OK to accept your changes or Cancel to discard them.
When youre done setting up your outcomes, you can then draw connectors from your Decision element to other elements on
the canvas and assign an outcome to each connector.

Adding and Configuring a Record Lookup Element


User Permissions Needed
To open, edit, or create a flow in the Cloud Flow Designer

Manage Force.com Flow

Use a Record Lookup element to find a Salesforce record and store the values from its fields into your flow. For example, you
could use a Record Lookup element to:

Input (or read) a bar code from a product tag and use the code to read data from the database to find out the product name
or description.
Look up item details to check for stock availability.
Look up a customer record to verify a caller's identity.

To add and configure a Record Lookup element:


1. Go to Your Name > Setup > Create > Workflow & Approvals > Flows and open a new or existing flow.
2. From the Palette, drag the Record Lookup element onto the canvas.
3. Enter the general settings for the element.
Field

Description

Name

Helps you identify the element on the canvas.

Unique Name

The requirement for uniqueness applies only to elements within the current flow. You can
have two elements with the same unique name, provided they are used in different flows.
A unique name is limited to underscores and alphanumeric characters. It must be unique,
begin with a letter, not include spaces, not end with an underscore, and not contain two
consecutive underscores.

Description

Appears after you click Add Description.

20

Flow Designer Elements

Adding and Configuring a Record Lookup Element

4. Select the object to identify which record type to look up.


5. Specify the filter criteria for selecting the record from the database.
Click Add Row to enter more filters. Click

to remove a row.

Column Header

Description

Field

Field for filtering records.

Operator

The available filter operators depend on the data type selected for the Field and Value.

Value

The Field and Value in the same row must have the same data type.
Options:

Select an existing flow resource, such as a variable, constant, or user input.


Select CREATE NEW to create a new flow resource.
Manually enter a literal value or merge field.
If you manually enter a date, you must use the MM/DD/YYYY format.

Make sure your filter criteria sufficiently narrows the search. The Record Lookup element ultimately returns only the first
record from the filtered results, which arent retrieved from the database in any particular order.
6. To sort the filtered results before the first record is selected:
a. Select Sort results by.
b. Select the field to sort by. Only sortable fields appear in the drop-down list.
c. Select the sort order, either ascending or descending.
7. Assign the values of fields in the returned record to variables in the flow.
Click Add Row to enter more field assignments. Click

to remove a row.

Column Header

Description

Field

Records field whose value you want to assign to a variable.

Variable

Select an existing flow variable, or select CREATE NEW to create a new variable.

8. Click OK.
Note: If the record lookup fails for some reason, the fault connector path will be taken if youve defined one.

See Also:
About the Fault Connector
Flow Designer Elements

21

Flow Designer Elements

Adding and Configuring a Record Create Element

Adding and Configuring a Record Create Element


User Permissions Needed
To open, edit, or create a flow in the Cloud Flow Designer

Manage Force.com Flow

Use the Record Create element to create a new record in Salesforce using values from your flow. For example, you could
capture the name and address that a user enters into the flow, use the Record Lookup element to see if they exist in Salesforce,
and if they don't, use the Record Create element to create a new record for that user.
1. Go to Your Name > Setup > Create > Workflow & Approvals > Flows and open a new or existing flow.
2. From the Palette, drag the Record Create element onto the canvas.
3. Enter a Name and Unique Name for the element.
Note: The requirement for uniqueness applies only to elements within the current flow. You can have two elements
with the same unique name, provided they are used in different flows. A unique name is limited to underscores
and alphanumeric characters. It must be unique, begin with a letter, not include spaces, not end with an underscore,
and not contain two consecutive underscores.
4. If you havent already added a description, click Add Description to do so.
5. Select the object for which you want to create a record.
6. Select the field or fields from the object that you want to populate, then assign a value or resource to the field. The data
types must match.
In the Value column, you can manually enter literal or merge field values. You can also select pre-defined flow values
(from variables, constants or user inputs, for example). Use the CREATE NEW section of the drop-down list to create
new resources, if necessary. When entering a date value, you must use the MM/DD/YYYY format.
7. Click Add Row to set the value of another field.
8. Click to remove a line.
9. Optionally, assign the new record's ID to a variable so you can use it or refer to it later in the flow. The variable you choose
must be of type text. If you havent created the variable yet, you can do that by expanding the CREATE NEW section
of the drop-down list.
10. Click OK to accept your changes or Cancel to discard them.
Important: Check your object definition to ensure that all required fields are populated with values; otherwise the
record create will fail at runtime. If the record create does fail, the fault connector path will be taken if youve defined
one.

See Also:
About the Fault Connector
Flow Designer Elements

22

Flow Designer Elements

Adding and Configuring a Record Update Element

Adding and Configuring a Record Update Element


User Permissions Needed
To open, edit, or create a flow in the Cloud Flow Designer

Manage Force.com Flow

Use a Record Update element to update a set of records in Salesforce with variable, constant, input, or other values from your
flow. You can update a single record, or multiple records, depending on how you set your filter criteria.
If you're using flows in a call center, for example, you can use a Record Update element to automatically update Salesforce
with data collected from callers, such as new addresses, phone numbers, or product preferences.
1. Go to Your Name > Setup > Create > Workflow & Approvals > Flows and open a new or existing flow.
2. From the Palette, drag the Record Update element onto the canvas.
3. Enter a Name and Unique Name for the element.
Note: The requirement for uniqueness applies only to elements within the current flow. You can have two elements
with the same unique name, provided they are used in different flows. A unique name is limited to underscores
and alphanumeric characters. It must be unique, begin with a letter, not include spaces, not end with an underscore,
and not contain two consecutive underscores.
4. If you havent already added a description, click Add Description to do so.
5. Select the object for which you want to update a record.
6. Set criteria to select which records get updated. The data types of the values in the Field and Value columns must match.
In the Value column, you can manually enter literal or merge field values. You can also select pre-defined flow values
(from variables, constants or user inputs, for example). Use the CREATE NEW section of the drop-down list to create
new resources, if necessary. When entering a date value, you must use the MM/DD/YYYY format.
Important: You must configure at least one filter, or you will update all the records for the object.

7. Click Add Row to add another filter.


8. Click to remove a line.
9. Update record fields with values from your flow:
a. Select a field on the record that you want to update.
b. Select a value from your flow (like a variable, constant or user input, for example) that you want to assign to the record's
field. Use the CREATE NEW section of the drop-down list to create new resources, if necessary.
c. Click Add Row to update another field.
d. Click

to remove a field.

10. Click OK to accept your changes or Cancel to discard them.

23

Flow Designer Elements

Adding and Configuring a Record Delete Element

Note: If the record update fails for some reason, the fault connector path will be taken if youve defined one.

See Also:
About the Fault Connector
Flow Designer Elements

Adding and Configuring a Record Delete Element


User Permissions Needed
To open, edit, or create a flow in the Cloud Flow Designer

Manage Force.com Flow

Use a Record Delete element to delete records in Salesforce. You can delete a single record or multiple records, depending on
how you set your filter criteria.
1. Go to Your Name > Setup > Create > Workflow & Approvals > Flows and open a new or existing flow.
2. From the Palette, drag the Record Delete element onto the canvas.
3. Enter a Name and Unique Name for the element.
Note: The requirement for uniqueness applies only to elements within the current flow. You can have two elements
with the same unique name, provided they are used in different flows. A unique name is limited to underscores
and alphanumeric characters. It must be unique, begin with a letter, not include spaces, not end with an underscore,
and not contain two consecutive underscores.
4. If you havent already added a description, click Add Description to do so.
5. Select the object whose records you want to delete.
6. Add rows of filter criteria to determine which records will be deleted. You must configure at least one filter.
In the Value column, you can manually enter literal or merge field values. You can also select pre-defined flow values
(from variables, constants or user inputs, for example). Use the CREATE NEW section of the drop-down list to create
new resources, if necessary. When entering a date value, you must use the MM/DD/YYYY format.
7. Click Add Row to add another filter.
8. Click to remove a line.
9. Click OK to accept your changes or Cancel to discard them.
Caution: Things to note when using a Record Delete element:

Be careful when testing flows that contain Record Delete elements. Even if the flow is inactive, running it will
trigger the delete operation.
To prevent deleting records by mistake, be as specific in your filter criteria as possible.
Records are deleted from your organization the moment the flow executes the Record Delete element.
Deleted records are sent to the Recycle Bin and remain there for 15 days before they are permanently deleted.

24

Flow Designer Elements

About Subflows

Note: If the record delete fails for some reason, the fault connector path will be taken if youve defined one.

See Also:
About the Fault Connector
Flow Designer Elements

About Subflows
Reduce the complexity of your flow by reusing other flows.
A subflow element references another flow and calls that flow at runtime. When a flow contains a subflow element, we call it
the master flow to distinguish it from the referenced flow.
With subflows, you can simplify your overall flow architecture. Build reusable flows to perform common tasks. For example,
you can build reusable flows to capture address and credit card information, and authorize a credit card purchase amount.
Then you can have multiple product-ordering flows call the reusable flows as needed.
At runtime, the master flow calls the active version of each referenced flow by default. If a referenced flow has no active version,
then the master flow calls the latest version of the referenced flow. To run only the latest version of each referenced flow, use
one of the following methods:

Open the master flow in the Cloud Flow Designer, and click Run with Latest in the button bar.
Run the master flow from the flow URL appended with ?latestSub=true.
Note: Only flow administrators can run inactive flows. For other users, the flow will fail at runtime if a subflow
element tries to call a flow with no active version.

The Palette lists the other flows in your organization. If you select a flow in the Palette, the following information appears in
the Description pane:

The flows unique name and description.


The version of the flow that would be called by default at runtime.
The flow versions variables that are available for input or output assignments.
From a subflow element, you can only assign values to or from the referenced flows variables that allow input/output
access. This access is determined by the Input/Output Type of the variable. If you need to change the variables
Input/Output Type, open the referenced flow to edit the variable.

Adding and Configuring a Subflow Element


Use a subflow element to have the flow call another flow at runtime.
Before you begin, create or install the other flow that you want to call.

25

Flow Designer Elements

Adding and Configuring a Subflow Element

A subflow element references another flow and calls that flow at runtime. When a flow contains a subflow element, we call it
the master flow to distinguish it from the referenced flow. Use subflow input and output assignments to transfer data between
the master flow and the referenced flow.
1. Click Your Name > Setup > Create > Workflow & Approvals > Flows and open a new or existing flow.
2. From the Palette, drag the flow that you want to call onto the canvas.
3. Enter the general settings for the subflow element.
Field

Description

Name

Helps you identify the element on the canvas.

Unique Name

The requirement for uniqueness applies only to elements within the current flow. You can have
two elements with the same unique name, provided they are used in different flows. A unique
name is limited to underscores and alphanumeric characters. It must be unique, begin with a
letter, not include spaces, not end with an underscore, and not contain two consecutive
underscores.

Description

Appears after you click Add Description.

4. On the Inputs tab, assign values to variables in the referenced flow.


These variable assignments occur when the master flow calls the referenced flow at runtime.
Click Add Row to enter more variable assignments. Click

to remove a row.

Column
Header

Description

Target

Referenced flows variable whose value you want to set.


By default, the subflow overlays drop-down lists for selecting the referenced flows variables are populated
with the variables of the currently active version of the referenced flow. If the referenced flow has no
active version, the drop-down lists are populated with the variables of the latest version of the referenced
flow. You can, however, view or select from the inputs and outputs of other versions of the referenced
flow.

Source

Master flows resource or value to assign to the target.


Options:

Select an existing flow resource, such as a variable, constant, or user input.


Select CREATE NEW to create a new flow resource.
Manually enter a literal value or merge field.
If you manually enter a date, you must use the MM/DD/YYYY format.

5. On the Outputs tab, assign values from the referenced flows variables to the master flows variables.
These variable assignments occur when the referenced flow finishes running.
Click Add Row to enter more variable assignments. Click

to remove a row.

26

Flow Designer Elements

Viewing Inputs and Outputs of Other Referenced Flow Versions

Column
Header

Description

Source

Referenced flows variable whose value you want to assign to the target.
By default, the subflow overlays drop-down lists for selecting the referenced flows variables are populated
with the variables of the currently active version of the referenced flow. If the referenced flow has no
active version, the drop-down lists are populated with the variables of the latest version of the referenced
flow. You can, however, view or select from the inputs and outputs of other versions of the referenced
flow.

Target

Master flows variable whose value you want to set.

6. Click OK.

Viewing Inputs and Outputs of Other Referenced Flow Versions


While configuring a subflow element, you can view the variables of a specified version of the referenced flow.
Before you begin, add a subflow element to your flow.
From a subflow element, you can only assign values to or from the referenced flows variables that allow input/output access.
This access is determined by the Input/Output Type of the variable. If you need to change the variables Input/Output
Type, open the referenced flow to edit the variable.
By default, the subflow overlays drop-down lists for selecting the referenced flows variables are populated with the variables
of the currently active version of the referenced flow. If the referenced flow has no active version, the drop-down lists are
populated with the variables of the latest version of the referenced flow.
If you want to populate the drop-down lists with the variables of another version of the referenced flow, or if you just want to
view the descriptions of the referenced flows variables, complete the following steps.
1. On the subflow overlay, expand the Input/Output Variable Assignments section.
2. Click View input/output of other versions.
3. Use one or more of the following options in the Select Version of Referenced Flow overlay.
Option

Description

Select a Version number in the left pane.

The Inputs and Outputs tabs display the variables in the selected version
of the referenced flow.

Select the Inputs tab or the Outputs tab.

The tab displays:


The variables available for input or output assignment in the selected
Version of the referenced flow.
The data type of each variable.
The description, if any, of each variable.

Click OK.

The subflow overlays drop-down lists for selecting the referenced flows
variables are populated with the variables of the selected Version of the
referenced flow.

27

Flow Designer Elements

Adding and Configuring an Apex Plug-in Element

When you configure subflow input and output assignments, you can specify variables from any version of the referenced flow.
This enables you to develop both the master flow and referenced flow in parallel, while keeping another version of the referenced
flow active for its users. When you save the master flow, however, the subflow validations are performed only against the
currently active versionor if there is no active version, then against the latest versionof the referenced flow. You may see
informational validation messages about the variables that couldnt be found or that were configured differently in the referenced
flow, but those messages wont block you from saving the flow. Nevertheless, be sure to resolve all validation errors before you
activate the master flow.

Adding and Configuring an Apex Plug-in Element


User Permissions Needed
To open, edit, or create a flow in the Cloud Flow Designer

Manage Force.com Flow

The Apex Plug-in element represents a piece of Apex code that you can include in a flow. It lets you call an Apex class with
the Process.Plugin interface and pass data between your organization and a flow.
When you open it, the Cloud Flow Designer discovers any Process.Plugin classes you created and displays them as elements
on the Palette. Select a plug-in on the Palette to view its tag, class name, inputs, and outputs in the Description pane. Required
inputs are listed with an asterisk (*).
Important: Before you can use an Apex Plug-in element in a flow, you must first write the Apex class that implements
the interface. Be sure your describe method is implemented correctly so the Flow Designer can pull the input and
output information. For more information about how to do that, see Using the Process.Plugin Interface in the
Force.com Apex Code Developer's Guide
To add or configure an Apex Plug-in element:
1. Go to Your Name > Setup > Create > Workflow & Approvals > Flows and open a new or existing flow.
2. From the Palette, drag an Apex Plug-in element onto the canvas. The class name and plug-in description are taken from
the plug-in code.
3. Enter a name for your new plug-in element.
4. If necessary, enter a different unique name.
Note: The requirement for uniqueness applies only to elements within the current flow. You can have two elements
with the same unique name, provided they are used in different flows. A unique name is limited to underscores
and alphanumeric characters. It must be unique, begin with a letter, not include spaces, not end with an underscore,
and not contain two consecutive underscores.
5. If you havent already added a description, click Add Description to do so.
6. On the Inputs tab, assign values to the Apex parameters.
Required parameters are automatically listed as targets. Click Add Row to set an optional parameter. Click
a row.
Column Header

Description

Target

Apex parameter whose value you want to set.

to remove

28

Flow Designer Elements

About Apex Plug-ins in Flows

Column Header

Description

Source

Value to assign to the Apex parameter.


Options:

Select an existing flow resource, such as a variable, constant, or user input.


Select CREATE NEW to create a new flow resource.
Manually enter a literal value or merge field.
If you manually enter a date, you must use the MM/DD/YYYY format.

7. On the Outputs tab, assign values from Apex parameters to variables in the flow.
Click Add Row to enter more output assignments. Click

to remove a row.

Column Header

Description

Source

Apex parameter whose value you want to get.

Target

Select an existing flow variable, or select CREATE NEW to create a new variable.

8. Click OK.
Note: If the Apex plug-in fails for some reason, the fault connector path will be taken if youve defined one.

See Also:
About Apex Plug-ins in Flows
About the Fault Connector
Flow Designer Elements

About Apex Plug-ins in Flows


The Apex Plug-in element represents a piece of Apex code that you can use to pass data between your organization and a
flow.
When using Apex plug-ins in a flow:

Add a tag string to your Apex plug-in to group your plug-ins in the Flow Designer Palette. If you don't add a tag string
to a plug-in, it shows up at the root level of the Apex Plug-ins section.
Apex primitive data types Blob and Time aren't supported for flow plug-ins.
If you don't provide a name for your plug-in, it displays in the Palette using the class name.
If you make code changes to an Apex plug-in while the Cloud Flow Designer is open, you won't see the changes in the
plug-in elements until you close and re-open the Designer.

29

Flow Designer Elements

Adding and Configuring an Assignment Element

Adding and Configuring an Assignment Element


User Permissions Needed
To open, edit, or create a flow in the Cloud Flow Designer

Manage Force.com Flow

Use the Assignment element to make changes to the value of a variable. For example, you could dynamically change the value
of a customer's credit score depending on how they answer certain questions in the flow.
1. Go to Your Name > Setup > Create > Workflow & Approvals > Flows and open a new or existing flow.
2. From the Palette, drag the Assignment element onto the canvas.
3. Enter a Name and Unique Name for the element.
Note: The requirement for uniqueness applies only to elements within the current flow. You can have two elements
with the same unique name, provided they are used in different flows. A unique name is limited to underscores
and alphanumeric characters. It must be unique, begin with a letter, not include spaces, not end with an underscore,
and not contain two consecutive underscores.
4. If you havent already added a description, click Add Description to do so.
5. In the Assignments section, select the variable you want to change. If you havent created the variable yet, you can do that
by expanding the CREATE NEW section of the drop-down list.
6. Select an operator.
7. Enter a value or select an element to adjust the variable you selected. Use the CREATE NEW section of the drop-down
list to create new resources, if necessary.
Note: When you add or subtract a number from a date value, the date adjusts in days, not hours.

8. Click Add Assignment to add another line. Click and drag assignment line items to reorder them.
9. Click to remove a line.
10. Click OK to accept your changes or Cancel to discard them.
Note: Every time you add an element or resource to a flow, it's also added to the Explorer Tab.

About the Connector Element


Connectors control how the flow is executed and are represented as arrows on the Flow Designer canvas.

Adding and Deleting Connectors


To add a connector between flow elements, click the node beneath the source element and drag and drop a line anywhere
onto a target element. To delete a connector, select it and press the DELETE key. If the source element has defined outcomes,
when you drop the connector onto its destination, you must select which outcome to assign to the path.

30

Flow Designer Elements

About the Fault Connector

Tip:

When you select a connector, its color changes from black to red.
You may find it easier to select a connector by clicking and dragging an area on the canvas that includes both ends
of the connector.

Connector Properties and Expected Behavior

When you click and drag an element around the canvas, each end of the connector stays stuck to its element and stretches
to accommodate the new element position. If you move the element into a new position in the flow, you must manually
adjust any connections and outcomes.
Deleting a connector doesn't delete the outcome associated with it, but deleting an element's outcome does delete the
associated connector.
Only Decisions, Steps and data elements can have more than one outgoing connector.
Some elements also support an outgoing fault connector.

The source and destination elements for a connector can't be the same.

See Also:
About the Fault Connector
Flow Designer Elements

About the Fault Connector


While a connector element determines the normal path of flow execution, a fault connector is executed at runtime only when
its source element results in an error.
A fault connector can have any target element but only the following source elements:

Apex Plug-In
Record Create
Record Update
Record Lookup
Record Delete

By default, if executing one of these elements results in an error, the flow displays a generic error message to the flow user.
Also, the user cant proceed with the flow. Use fault connectors to gracefully handle such errors. For example:

Suppose an Apex plug-in element calls an external Web service to validate user-entered addresses. If the Web service call
fails for any reason, the flow can proceed along the fault connector to a screen where the user can verify the entered address,
make any corrections, and proceed with the flow.
If the flow is used only internally, for example by call center users, each fault connectors target screen can display a system
fault message that flow users can give to the IT department. For example, you can set up a Display Text field on the screen
as follows:
Sorry, but you cant update records at this time.
Please open a case with IT, and include the following error message:
{!$Flow.FaultMessage}

31

Flow Designer Elements

About the Fault Connector

You can ignore the errors completely, and have the flow proceed along the normal path. To do this, add a fault connector
on top of the connector element.

Add and delete a fault connector just as you would add and delete a connector element, only you need to add the connector
element first. The connector element properties and expected behavior also apply to fault connectors.

See Also:
About the Connector Element
Flow Designer Elements

32

Chapter 4
Flow Designer Resources
In this chapter ...

Adding and Configuring a Constant


Adding and Configuring a Variable
Adding and Configuring a Formula
Adding and Configuring a Text
Template
Adding and Configuring a Choice
Adding and Configuring a Dynamic
Choice
About Global Constants in the Cloud
Flow Designer

Available in: Enterprise, Unlimited, and Developer Editions

Resources, such as variables, constants, or formulas, allow you to store or


manipulate data and use it throughout your flow. For example, if a user inputs
the cost of a meal in a tip calculator flow, you can store that value as a constant
and use it with a formula to calculate optimum tip amount based on what service
level the user chooses later in the flow.
Resources are non-visual elements. They won't show up on your canvas and can't
be added to it. If you need to edit or delete resources youve created, you can find
them on the Explorer tab.
The following resources are available in the Cloud Flow Designer:

Constant
Variable
Formula
Text Template
Choice
Dynamic Choice
Global Constants
Though they dont appear on the Resources tab, global constants are
considered to be resources. Global constants have fixed values, while the other
resources can be created and customized as needed.
Note: Every time you add an element or resource to a flow, it's also
added to the Explorer Tab.

33

Flow Designer Resources

Adding and Configuring a Constant

Adding and Configuring a Constant


User Permissions Needed
To open, edit, or create a flow in the Cloud Flow Designer

Manage Force.com Flow

In order to assign constants to your flow using the Assignment element, you first need to create them. The Constant resource
allows you to a define a fixed value that can be used throughout your flow. Every time you create a new constant, it is added
to the Explorer tab by its unique name.
1. Go to Your Name > Setup > Create > Workflow & Approvals > Flows and open a new or existing flow.
2. From the Resources tab, double-click Constant.
3. Enter a Unique Name for the constant.
Note: The requirement for uniqueness applies only to elements within the current flow. You can have two elements
with the same unique name, provided they are used in different flows. A unique name is limited to underscores
and alphanumeric characters. It must be unique, begin with a letter, not include spaces, not end with an underscore,
and not contain two consecutive underscores.
4.
5.
6.
7.

Enter a description.
Set the Data Type for the constant.
Enter a value for the constant. When entering a date value, you must use the MM/DD/YYYY format.
Click OK to accept your changes or Cancel to discard them.

Adding and Configuring a Variable


User Permissions Needed
To open, edit, or create a flow in the Cloud Flow Designer

Manage Force.com Flow

In order to assign variables to your flow using the Assignment element, you have to first create them. The Variable resource
allows you to create updatable values to use in your flow. Every time you create a new variable, an item representing that
variable is added to the Explorer tab.
1. Go to Your Name > Setup > Create > Workflow & Approvals > Flows and open a new or existing flow.
2. From the Resources tab, double-click Variable.
3. Fill out the fields.
Field

Description

Unique Name

The requirement for uniqueness applies only to elements within the current flow. You can
have two elements with the same unique name, provided they are used in different flows.
A unique name is limited to underscores and alphanumeric characters. It must be unique,

34

Flow Designer Resources

Adding and Configuring a Variable

begin with a letter, not include spaces, not end with an underscore, and not contain two
consecutive underscores.
Description

Helps you determine when to assign or use this variable as you set up your flows.
The description appears in the Description pane when the variable is selected in the Explorer
tab. Depending on the Input/Output Type, the variables description may be viewed
from another flows subflow element.

Data Type

Determines the types of values that can be assigned to the variable.

Scale

Appears only when the Data Type is set to Number or Currency.


The scale is the maximum number of digits allowed to the right of the decimal point. This
number can't exceed 17. If you leave this field blank or set to zero, only whole numbers are
displayed when your flow runs.

Input/Output Type

Determines whether the variable can be accessed outside the flow.


PrivateVariable can be assigned and used only within the flow.
InputVariable can be set at the start of the flow using URL parameters, Visualforce
controllers, or subflow inputs.
OutputVariables value can be accessed from Visualforce controllers and other flows.
This field doesnt affect how variables are assigned or used within the same flow, for example,
through these types of elements: Assignment, Record Create, Record Lookup, and Apex
Plug-in.
The default value of the field depends on the release or API version in which the variable
is created:

Private for a variable created in Summer 12 and later or in API version 25.0 and later.
Input and Output for a variable created in Spring 12 and earlier or in API version

24.0.
Caution: Disabling input or output access for an existing variable may impact the
functionality of applications and pages that call the flow and access the variable via
URL parameters, Visualforce controllers, and subflows.
Default Value

Enter a default value for the variable, or use the drop-down list to assign the value of a flow
resource as the default. Use the CREATE NEW section of the drop-down list to create
new resources, if necessary. If you leave this field blank, the variable value is set to null.
When entering a date value, you must use the MM/DD/YYYY format.

4. Click OK to accept your changes or Cancel to discard them.


You can delete a variable at any time. Any variable assignments and allocations using the deleted variable will be set to null.

35

Flow Designer Resources

Adding and Configuring a Formula

Adding and Configuring a Formula


User Permissions Needed
To open, edit, or create a flow in the Cloud Flow Designer

Manage Force.com Flow

Use the Formula resource to calculate a value using numeric elements in your flow. Every time you create a new formula, its
added to the Explorer tab by its unique name.
1. Go to Your Name > Setup > Create > Workflow & Approvals > Flows and open a new or existing flow.
2. From the Resources tab, double-click Formula.
3. Enter a Unique Name for the formula.
Note: The requirement for uniqueness applies only to elements within the current flow. You can have two elements
with the same unique name, provided they are used in different flows.A unique name is limited to underscores and
alphanumeric characters. It must be unique, begin with a letter, not include spaces, not end with an underscore,
and not contain two consecutive underscores.
4. Enter a description.
5. If needed, set the Scale for the formula. The scale is the maximum number of digits allowed to the right of the decimal
point. This number can't exceed 17. If you leave this field blank or set to zero, only whole numbers are displayed when
your flow runs.
6. Enter your formula. Use the arrowhead to select resources from your flow. Use the CREATE NEW section of the
drop-down list to create new resources, if necessary. See the Formulas Quick Reference Guide for a complete list of formula
operators and functions supported in Salesforce.
Note: Some formula operators are not supported in the Cloud Flow Designer and will result in your formula
returning a null value. See About Formulas in Flows for the complete list.
7. Click OK to accept your changes or Cancel to discard them.

About Formulas in Flows


You can use standard Salesforce formula syntax in two places within a flow:

In a Formula resource
In a Screen element, specifically to validate user input for a field

The Formula Resource


The Formula resource calculates a numeric value using functions and elements in your flow. Consider the following when
creating a Formula resource.

You can use pure text functions in your formula, but the formula output must be numeric. Any formula that doesn't resolve
to a number or that contains an unsupported function returns null.
If you display the result of an invalid formula to a user using a Display Text element, the formula result is displayed as an
empty string and the user sees nothing.
You can't activate a flow that contains an invalid formula.

36

Flow Designer Resources

Adding and Configuring a Text Template

Formulas in Validation Rules


You can use formulas in validation rules to validate a flow user's input by selecting the Validate checkbox when configuring
an input field on a Screen element.

The formula expression must return a Boolean value.


If the formula statement evaluates to TRUE, the input is valid. If the formula statement evaluates to FALSE, the error
message is displayed to the user.
If the user leaves the field blank, and the field is not required, no validation is performed.

Flow Formula Limitations

Your formula can't contain more than 3,000 characters.


Formulas in the Cloud Flow Designer don't support the following functions. Using these functions results in your formula
returning null.

GETRECORDIDS
IMAGE
INCLUDE
INCLUDES
ISCHANGED
ISNEW
ISPICKVAL
PARENTGROUPVAL
PREVGROUPVAL
PRIORVALUE
REQUIRE SCRIPT
VLOOKUP

To learn more about how formulas work in Salesforce, see About Formulas in the online help.

Adding and Configuring a Text Template


User Permissions Needed
To open, edit, or create a flow in the Cloud Flow Designer

Manage Force.com Flow

Use the Text Template resource to create text to use in your flow. For example, if you have a flow that registers people for an
event, you could create a text template that includes a registrant's name, address, and other information, then use the template
in an email confirmation sent out when the flow finishes. Every time you create a new text template, it is added to the Explorer
tab by its unique name.
1. Go to Your Name > Setup > Create > Workflow & Approvals > Flows and open a new or existing flow.
2. From the Resources tab, double-click Text Template.
3. Enter a Unique Name.

37

Flow Designer Resources

Adding and Configuring a Choice

Note: The requirement for uniqueness applies only to elements within the current flow. You can have two elements
with the same unique name, provided they are used in different flows.A unique name is limited to underscores and
alphanumeric characters. It must be unique, begin with a letter, not include spaces, not end with an underscore,
and not contain two consecutive underscores.
4. Enter a description.
5. In the text box, type the text for your template. Use the Select resource drop-down to insert content from your flow
(variables, constants, user input, and so on), or type it manually. Use the CREATE NEW section of the drop-down list
to create new resources, if necessary.
Click to switch between the plain text editor and the rich text editor. If you use the rich text editor, the content is saved
as HTML.
6. Click OK.

Adding and Configuring a Choice


Available in: Enterprise, Unlimited, and Developer Editions

User Permissions Needed


To open, edit, or create a flow in the Cloud Flow Designer

Manage Force.com Flow

A Choice resource is a standalone choice option that you can reference or reuse throughout your flow. For example, if you
have a flow asking users to choose a particular service level, you could create separate choice options for Gold, Silver, and
Bronze. Each one becomes a unique choice resource on the Explorer tab. You could then set up a Screen later on in the flow
with a display text field that includes the choice resource with a description of the features included.
You can create a choice resource in two ways:

From the Resources tabDouble-click Choice in the resources list.


From anywhere the CREATE NEW drop-down list option is available.

On the Choice overlay:


1. Enter a label for the choice field.
2. If you want to use the rich text editor to format your field label, click the rich text editor icon ( ) to the right of the Label
field.
a. Once youre done editing the text, click OK. The Label field display changes to indicate that it is now a rich text field.

b. Click Edit to make changes to your label text.


c. Click Clear to completely clear the Label field and start over.
3. If necessary, customize the Unique Name.
4. If you havent already added a description, click Add Description to do so.

38

Flow Designer Resources

Adding and Configuring a Dynamic Choice

5. Set the choices Value Data Type.


6. If desired, fill in a Stored Value.
If a user leaves a choice blank or unselected, its stored value is set to null.
7. Select the Show input on selection checkbox to have a user input field appear below the choice option. This option
isnt available if the choices data type is Boolean.
a. Enter a label for the user input field.
b. Select the Required checkbox to make the user input field required.
c. In the Input Validation section, create a formula expression to validate the user input for the field.
i. Select Validate.
ii. Enter a formula expression to define the values allowed for the field.
iii. Customize the error message that will be displayed to the flow user if the input fails validation.
Click to switch between the plain text editor and the rich text editor. If you use the rich text editor, the content
is saved as HTML.
Note:

If the formula statement evaluates to TRUE, the input is valid. If the formula statement evaluates to FALSE,
the error message is displayed to the user.
If the user leaves the field blank, and the field is not required, no validation is performed.

8. Click OK.
After you create a choice, it shows up on the Explorer tab, where you can edit it as needed.

Adding and Configuring a Dynamic Choice


User Permissions Needed
To open, edit, or create a flow in the Cloud Flow Designer

Manage Force.com Flow

A dynamic choice looks up data from an objects records and dynamically generates a set of choices at runtime. Throughout
your flow, you can reuse a Dynamic Choice resource for choice fields, and you can reference the stored value of a Dynamic
Choice resource. The stored value is determined by the most recent user selection of a choice within the generated set.
As an example, let's say you're setting up a flow for all employees of Acme Inc. and need them to identify which Acme division
they work in. Instead of manually entering each division name as a separate radio button, you could set up the dynamic choice
to look up all instances where Acme appears in the division name. Then, when the employees step through the flow, they
can select from a dynamically generated list of all division names containing Acme.
1. Go to Your Name > Setup > Create > Workflow & Approvals > Flows and open a new or existing flow.
2. Create a dynamic choice using one of the following methods:

From the Resources tab, double-click Dynamic Choice.


From the Screen overlay, add or select a choice field (radio buttons or drop-down list) in the preview pane. In the
Choice Settings for that field, select CREATE NEW > Dynamic Choice

39

Flow Designer Resources

Adding and Configuring a Dynamic Choice

From any resource-selecting drop-down list, select CREATE NEW > Dynamic Choice.

3. Enter the general settings for the choice.


Field

Description

Unique Name

The requirement for uniqueness applies only to elements within the current flow. You can
have two elements with the same unique name, provided they are used in different flows.
A unique name is limited to underscores and alphanumeric characters. It must be unique,
begin with a letter, not include spaces, not end with an underscore, and not contain two
consecutive underscores.

Description

Appears after you click Add Description.

Value Data Type

Data type of the choices stored value.

4. Select the object whose records contain the data for the generated choices.
5. Specify the filter criteria for retrieving records from the database.
Click Add Row to enter more filters. Click

to remove a row.

Column Header

Description

Field

Field for filtering records.

Operator

The available filter operators depend on the data type selected for the Field and Value.

Value

The Field and Value in the same row must have the same data type.
Options:

Select an existing flow resource, such as a variable, constant, or user input.


Select CREATE NEW to create a new flow resource.
Manually enter a literal value or merge field.
If you manually enter a date, you must use the MM/DD/YYYY format.

If you remove all filter rows, all records of the selected object are retrieved and a choice is generated for each record.
6. Select the records fields whose values you want to use in the generated choices.
Field

Description

Choice Label

Records field whose value appears as the choice label at runtime.


Make sure to choose a field that contains data. Otherwise, users see blank generated choices
at runtime.

Choice Stored Value

Records field whose value is stored when the user selects this choice at runtime.
The available options depend on the Value Data Type of the Dynamic Choice resource.
If you dont fill out this field, the stored value is set to null.

40

Flow Designer Resources

About Global Constants in the Cloud Flow Designer

For example, let's say you're setting up a support flow for a computer hardware manufacturer, and you want to let users
identify a product to find its latest drivers. You could set up a dynamic choice that displays all products whose product ID
starts with a specific string of characters. However, since the flow users are more likely to know the product's name than
its ID, you would select a field containing the product name for the Choice Label.
7. To sort the generated choices:
a. Select Sort results by.
b. Select the records field to sort by. Only sortable fields appear in the drop-down list.
c. Select the sort order, either ascending or descending.
8. To limit the number of generated choices:
a. Select Limit number of choices to.
b. Enter the maximum number of choices (up to 200) to include in the generated set.
9. Set up field assignments that occur at runtime when the user selects a choice from the generated set. Use flow variables to
store field values from the record associated with the user-selected choice.
Click Add Row to enter more field assignments. Click

to remove a row.

Column Header

Description

Field

Records field whose value you want to assign to a variable.

Variable

Select an existing flow variable, or select CREATE NEW to create a new variable.

Lets return to our example where the flow user selects a product name from the generated set of choices. If, elsewhere in
the flow, you want to refer to or display the associated product ID and product description, you would assign flow variables
to store the relevant field values from the user-selected record.
10. Click OK.
After you create a dynamic choice, it shows up on the Explorer tab, where you can edit it as needed.

About Global Constants in the Cloud Flow Designer


Available in: Enterprise, Unlimited, and Developer Editions

In any value or resource drop-down list in the Cloud Flow Designer, you may see a section called GLOBAL CONSTANT.
Global constants are system values that, depending on the context of the drop-down list, let you assign EmptyString, True,
or False as the value for that field.

41

Flow Designer Resources

About Global Constants in the Cloud Flow Designer

For example, when creating a variable of type Boolean, if you click on the arrow button to the right of the Default Value
field and expand the GLOBAL CONSTANT section, youll see $GlobalConstant.True and $GlobalConstant.False.
However, when creating a variable of type Currency, the GLOBAL CONSTANT section isnt available. Visibility of this
section depends on the data type of the resource youre working with.
The global constants possible are:

{!$GlobalConstant.EmptyString}available for resources of type Text


{!$GlobalConstant.True}available for resources of type Boolean
{!$GlobalConstant.False}available for resources of type Boolean

42

Chapter 5
Flow Administration
In this chapter ...

Managing Your Flows


Editing Flow Properties
Putting Flows to Work
Adding a Flow to a Visualforce Page
Setting Flow Finish Behavior

A flow starts out as a process or decision diagram created in the Flow Designer.
Once uploaded and run in Salesforce, it becomes an application for navigating
users through a series of screens.
To get started using flows, click Your Name > Setup > Create > Workflow &
Approvals > Flows. From the list page, you can:

Create a new flow in the Cloud Flow Designer.


Open a flow that was created in the Cloud Flow Designer. If there is no
version of the flow activated, Open launches the latest version.
View details about a flow by clicking its name.
Edit the name or description of a flow.
See flow status.
Upload a flow file created in the desktop Flow Designer.
Get information about the desktop Flow Designer.

43

Flow Administration

Managing Your Flows

Managing Your Flows


Available in: Enterprise, Unlimited, and Developer Editions

User Permissions Needed


To view a flow:

View Setup and Configuration

To upload, activate, deactivate, edit, and delete flows:

Manage Force.com Flow

To open, edit or create a flow in the Cloud Flow Designer:

Manage Force.com Flow

To run a flow as a user directly from the flow URL, or from Run Flows
a custom Web tab, link, or button pointing to the flow URL:
OR
Force.com Flow User field enabled on the user detail page

To run a flow from the flow detail page, list page, or from
Manage Force.com Flow
within the Cloud Flow Designer, or to run an inactive flow:

You can have several different versions of a single flow in Salesforce, but only one version of each flow can be active at a time.
To manage a flow, go to Your Name > Setup > Create > Workflow & Approvals > Flows and click a flow name.
On the flow detail page you can:

View a list of all versions of the flows that youve uploaded. By default, flow versions are sorted by Created Date.
Activate a version of the flow.
Note: When you activate a new version of a flow, the previously activated version (if one exists) is automatically
deactivated. Flow processes currently running continue to run using the version with which they were initiated.

Delete a flow or flow version:


Click the Delete button to delete the flow completely, including all versions.
Click the Del link in the Flow Versions list to delete inactive versions of the flow.
Note: You cant delete an active flow. Once deactivated, you must wait 12 hours to delete a flow or flow version.
This ensures that flows in progress have time to complete. Flows that have never been activated can be deleted
immediately.

Open a flow or flow version created in the Cloud Flow Designer. Only users with the Manage Force.com Flow permission
can open flows.
Important: The Cloud Flow Designer cant open flows created in the desktop Flow Designer. The reverse is also
true.
Click the Open button to open the active version of the flow. If there is no version of the flow activated, Open launches
the latest version.

44

Flow Administration

Managing Your Flows

Click the Open link in the Flow Versions list to open a specific version of the flow.
Note: You cant make direct changes to an active flow. If you open an active version of a flow, you can make
edits, but you cant save those edits unless you save as either a new flow or new flow version.

Run a flow or flow version.


Click the Run button to run the active version of the flow. If there is no active version, the Run button runs the latest
version.
Click the Run link next to the version name to run an individual flow version. Only users with the Manage Force.com
Flow permission can run inactive flows.
Note: To allow other Salesforce users to run active flows directly, create a custom Web tab, link, or button pointing
to the flow URL. Include the namespace prefix in the flow URL when pointing users to a flow installed from a
package. If the flow contains subflow elements and you want to call the latest version of each referenced flow,
append ?latestSub=true to the URL.
Users running flows this way must have the Run Flows permission or have Force.com Flow User enabled
on their user detail page. For more information, see User Fields in the online help.

Edit the name or description of the flow.


See the flow namespace prefix, if it was installed from a managed package. You cannot open flows that come from a
managed package.
See flow status. Inactive flows are valid and can be activated. Draft flows are inactive, invalid, and cant be activated.
Deactivate the active version of the flow.

45

Flow Administration

Editing Flow Properties

Editing Flow Properties


Available in: Enterprise, Unlimited, and Developer Editions

User Permissions Needed


To view a flow:

View Setup and Configuration

To upload, activate, deactivate, edit, and delete flows:

Manage Force.com Flow

To open, edit or create a flow in the Cloud Flow Designer:

Manage Force.com Flow

To run a flow as a user directly from the flow URL, or from Run Flows
a custom Web tab, link, or button pointing to the flow URL:
OR
Force.com Flow User field enabled on the user detail page

To run a flow from the flow detail page, list page, or from
Manage Force.com Flow
within the Cloud Flow Designer, or to run an inactive flow:

The name and description of a flow in Salesforce make up the flow properties. The properties of a flow and its flow versions
are separate. Depending on which Flow Designer you used to create the flow, you can change this information in different
ways.
Note: If you created your flow using the desktop Flow Designer, upon upload of a new flow file, its name and
description in Salesforce are taken from the name and description fields within the file.

Editing the Properties of a Flow


You can edit flow properties two ways:

On the flow list page, click Edit next to a flow name. To go to the flow list page, click Your Name > Setup > Create >
Workflow & Approvals > Flows.
On the flow detail page, click the Edit button.

If you haven't yet edited the flow properties in Salesforce, the name and description field contents can fluctuate. Here's how:

If you haven't edited the name and description, and you activate a version of your flow, the name and description fields
update to reflect those of the active version.
If you haven't edited the name and description, and there is no version activated, the flow name and description reflect
those of the most recently-uploaded version, if your flow was created in the desktop Flow Designer.
Important: Once you edit the name and description of your flow in Salesforce, those fields no longer automatically
update when you upload or activate a new version.

Editing the Properties of a Flow VersionCloud Designer


To edit the properties of a flow version created using the Cloud Flow Designer:
1. Go to Your Name > Setup > Create > Workflow & Approvals > Flows.

46

Flow Administration

Putting Flows to Work

2. Click the name of a flow.


3. Click the Open link next to the flow version.
4. After the Cloud Flow Designer launches, click the flow properties button (
).
5. Change the name or description as needed. You can edit the name and description of your flow version this way at any
time, but you can only change its unique name when saving it for the first time.

Editing the Properties of a Flow VersionDesktop Designer


The properties of a flow version created using the desktop Designer are derived from the name and description fields within
the flow file. You can't edit these in Salesforce. If you open the flow version file in the desktop Designer, change the name
and description, then re-upload it, a new version is created with the updated information, but it won't overwrite the original
version properties.

Putting Flows to Work


Available in: Enterprise, Unlimited, and Developer Editions

You can share flows with users in three ways.


Embed flows in a Visualforce page and incorporate that page into a Force.com app with a custom button, link, or
Visualforce tab
Use this method when the people wholl be using your flow are all users in your organization and you want to customize
the flows look and feel.
For example, this method is appropriate if youre using flows to script calls for your companys customer support center
and you want to design a custom tab from which they can select a script to use. Or, if you want to customize the way
leads are created in Salesforce, you can override the New button on the Leads home page and have it point to a custom
Visualforce page with an embedded flow that captures only the lead information you want.
Users running a flow delivered this way must have access to the Visualforce page. They must also have the Run Flows
permission, or their user detail page must have the Force.com Flow User field enabled.
Embed flows in a Visualforce page and incorporate that page into a Force.com site, Customer Portal, or Partner
Portal
Use this method when you want to share a flow with members of the public who arent standard users in your organization.
For example, this method is appropriate if you want to set up a self-service tool for your public Force.com site to help
visitors generate custom sales quotes. Since the flow is embedded in a Visualforce page, you can customize the appearance
of the flow so it uses your companys branding and style.
Site and portal users running a flow delivered this way must have access to the Visualforce page. They dont need any
other permissions.
Note: When making a flow available to site or portal users, be sure to point them to the URL of the Visualforce
page that contains the embedded flow, not to the URL of the flow itself. Site and portal users dont have the
privileges to run flows directly.

47

Flow Administration

Adding a Flow to a Visualforce Page

Give users access to the flow URL, either directly or through a custom button, link or web tab
Use this method when the people wholl be using your flow are all users in your organization and you dont need to
customize its look and feel.
You can find the direct URL of a flow on its detail page at Your Name > Setup > Create > Workflow & Approvals >
Flows. Include the namespace prefix in the flow URL when pointing users to a flow installed from a managed package.
If the flow contains subflow elements and you want to call the latest version of each referenced flow, append
?latestSub=true to the URL.
Users running flows this way must have the Run Flows permission or have Force.com Flow User enabled on their
user detail page. For more information, see User Fields in the online help.

Adding a Flow to a Visualforce Page


Available in: Enterprise, Unlimited, and Developer Editions

User Permissions Needed


To create, edit, and set version settings for Visualforce pages: Customize Application
To upload, activate, deactivate, edit, and delete flows:

Manage Force.com Flow

To customize a flow's look and feel or enhance its functionality you can embed it as a component in a Visualforce page. If
your organization has flows enabled for sites and portals, you can then deliver the flow to your Force.com site, Customer
Portal, or partner portal users.
Note: Users can only run flows that have an active version. If the flow you embed doesn't have an active version, users
see an error message. If the flow you embed includes a subflow element, the flow that is referenced and called by the
subflow element must have an active version.
To add a flow to a Visualforce page, embed it using the <flow:interview> component:
1. Find the flow's unique name:
a. Go to the flow list page at Your Name > Setup > Create > Workflow & Approvals > Flows.
b. Click the name of the flow you want to embed.
2. Define a new Visualforce page or open one that you want to edit.
3. Add the <flow:interview> component, somewhere between the <apex:page> tags.
4. Set the name attribute to the unique name of the flow. For example:
<apex:page>
<flow:interview name="MyUniqueFlowName"/>
</apex:page>

Note: If the flow is from a managed package, then the name attribute must be in this format:
namespace.flowuniquename.

48

Flow Administration

Setting Flow Finish Behavior

5. Restrict which users can run the flow by setting the page security for the Visualforce page that contains it.
If the Visualforce page containing the flow is delivered externally to site or portal users, any of those users with access to
the Visualforce page can run the embedded flow.
If the Visualforce page containing the flow is delivered to users within your organization through a custom Web tab, link,
or button, users must have access to the page. They must also have the Run Flows permission or have the Force.com
Flow User field enabled on their user detail page.
In addition to the other flow customizations available with Visualforce, you can also shape what happens when a user clicks
Finish on the final screen. For a simple example, see Setting Flow Finish Behavior on page 49.
For more examples of using flows in Visualforce, including how to customize the runtime user interface or make a flow interact
with other components on the page, see the Visualforce Developer's Guide.

Setting Flow Finish Behavior


Available in: Enterprise, Unlimited, and Developer Editions

Because flows are rendered using Visualforce, you can use the finishLocation attribute to redirect users to another screen
in Salesforce when they click Finish.
Note:

If finishLocation isn't specified, users that click Finish are routed back to the first screen of the flow.
If you use a standard controller to display a record on the same page as the flow, users that click Finish are routed
back to the first screen of the flow, without the record. This is because the id query string parameter isnt preserved
in the page URL. If needed, configure the finishLocation to route users back to the record.
You can't redirect flow users to a URL thats external to your Salesforce organization.

Set a flow's final screen in one of these ways.

Embed the flow as a component in a Visualforce page and configure finishLocation manually.
Here's a simple example, using the URLFOR function. You can use URLFOR to:
Route users to a relative URL, such as the Salesforce home page.
<apex:page>
<flow:interview name="flowname" finishLocation="{!URLFOR('/home/home.jsp')}"/>
</apex:page>

Route users to a specific record or detail page using its ID. For example, if you wanted to route users to a detail page
with an ID of 001D000000IpE9X:
<apex:page>
<flow:interview name="flowname" finishLocation="{!URLFOR('/001D000000IpE9X')}"/>
</apex:page>

For more examples, see "Configuring the finishLocation Attribute in a Flow" in the Visualforce Developer's Guide.

49

Flow Administration

Setting Flow Finish Behavior

Note:

If you deliver a flow to your users from a custom button, link, or Web tab that points to the flow URL, we
recommend against using retURL in the URL path to redirect them. Using retURL can cause the destination
page you specify to be rendered with top and side navigation bars nested within the existing Salesforce top and
side navigation bars.
You can't redirect flow users to a URL thats external to your Salesforce organization.

50

Chapter 6
Running Flows
Available in: Enterprise, Unlimited, and Developer Editions

User Permissions Needed


To view a flow:

View Setup and Configuration

To run a flow as a user directly from the flow URL, or from a Run Flows
custom Web tab, link, or button pointing to the flow URL:
OR
Force.com Flow User field enabled on the user detail page

To run a flow from the flow detail page, list page, or from
within the Cloud Flow Designer, or to run an inactive flow:

Manage Force.com Flow

Flows are a collection of scripted screens that you can step through to collect and update data. For example, as a support
representative in a call center, you can use flows to capture information as you help troubleshoot customer issues. Or as a
salesperson, you can use flows to generate real-time quotes. You can even use flows to manipulate your organization's data in
new ways.
Depending on how flows are set up in your organization, you can run them directly from the flow URL in your browser, or
from a custom Web tab, link, or button pointing to the URL.
If your administrator hasn't defined custom Web tabs, links, or buttons for flows, you can find the direct flow URL by going
to Your Name > Setup > Create > Workflow & Approvals > Flows and clicking on the name of the flow you want to run.
Consider the following when running flows:

Don't use your browser's Back or Forward buttons to navigate through a flow. This may result in inconsistent data between
the flow and Salesforce.
A single flow may have up to 50 different versions. When you run a flow, you see the active version, which may not necessarily
be the latest version.

Flow administrators can also run flows directly from the flow detail page.

51

Chapter 7
Flows in Change Sets and Packages
In this chapter ...

Available in: Enterprise, Unlimited, and Developer Editions

Flows created in the Cloud Flow Designer can be included in both change sets
and packages. The recipient organization of either the change set or package
must have Visual Workflow enabled.

About Flows in Change Sets

You can only include one version of a flow in a change set.


If there is no active version available when you click Upload, the latest inactive
version is used.
When you view the dependent components for the change set, the Component
Dependencies page lists the dependencies for all versions of the flow. Add
all interdependent components for the relevant flow version to the outbound
change set.
An active flow in a change set will be inactive once deployed to its destination.
You must manually activate it after deployment.
Deploying or re-deploying a flow using change sets will always create a new
version of the flow in the destination organization.

About Flows in Packages

Flows can be included in both managed and unmanaged packages.


You can only package active flows. The active version of the flow is determined
when you click to upload a package version. The upload fails if there arent
any active versions of the flow.
When creating a custom button, link, or Web tab to point to a flow installed
from a managed package, be sure to include the namespace in the URL. The
URL format is: /flow/namespace/flowuniquename.
When embedding a flow installed from a managed package in a Visualforce
page, you must set the name attribute to this format:
namespace.flowuniquename.
If you want to update a managed package with a different flow version, activate
that version and upload the package again. You dont need to add the
newly-activated version to the package. However, if you activate a flow version
by mistake and upload the package, youll distribute that flow version to
everyone. Be sure to verify which version you really want to upload.
An active flow in a package will be active once installed. The previous active
version of the flow in the destination organization is deactivated in favor of
the newly-installed version. Any in-progress flows based on the

52

Flows in Change Sets and Packages

now-deactivated version will continue to run without interruption, but will


reflect the previous version of the flow.
If you install a package containing multiple flow versions in a fresh destination
organization, only the latest flow version included in the package is deployed.
Upgrading a managed package in your organization installs a new flow version
only if there is a newer flow version from the developer. After several upgrades,
you may end up with multiple flow versions.
If you install a flow from an unmanaged package that has the same name but
a different version number as a flow already in your organization, the
newly-installed flow becomes the latest version of the existing flow. However,
if the packaged flow has the same name and version number as a flow already
in your organization, the package install will fail. You cant overwrite a flow.
Referential integrity works the same for flows as it does for other packaged
elements.

When working with flows in packages, consider these limitations:

The Cloud Flow Designer cant open flows installed from managed packages.
You cant delete a flow from an installed package. To remove a packaged flow
from your organization, you must first deactivate it, wait 12 hours, then
uninstall the package.
In a development organization, you cant delete a flow or flow version once
youve uploaded it to a released or beta managed package.
You cant delete flow components from Managed - Beta package installations
in development organizations.
Flows cant be included in package patches.
If you have multiple versions of a flow installed from multiple unmanaged
packages, you cant remove only one version by uninstalling its package.
Uninstalling a packagemanaged or unmanagedthat contains a single
version of the flow removes the entire flow, including all versions.

53

Chapter 8
Flow Limits
Available in: Enterprise, Unlimited, and Developer Editions

The following limits apply to flows in Salesforce:


Maximum number of versions per flow

50

Maximum number of executed elements at runtime

2000

Maximum number of active flows per organization

500

Maximum number of flows per organization

1000

Maximum size of uploaded flow file

3 MB

If you exceed your organization's site usage limits or Visualforce usage limits, you can't run flows.

54

Chapter 9
Visual Workflow Considerations
Available in: Enterprise, Unlimited, and Developer Editions

When creating, managing, and running flows, consider the permissions, use limits, and data issues.

The Cloud Flow Designer

Be careful when testing flows that contain Record Delete elements. Even if the flow is inactive, running it will trigger the
delete operation.
When entering a date value, you must use the MM/DD/YYYY format.
The Flow Designer doesn't support UTF-8 encoding for text in user input fields.
The Flow Designer uses the permissions and locale assigned to the current user.
The Cloud Flow Designer contains embedded fonts for all locales it supports. The supported locales are:

English (US)
French (France)
German (Germany)
Spanish (Spain)
Japanese (Japan)
Chinese (Traditional)
Chinese (Simplified)

If you enter unsupported characters for a supported locale, theyre displayed using system fonts instead of the embedded
fonts.
In unsupported locales, your system font settings are used to display all characters in the Cloud Flow Designer.

If the Cloud Flow Designer doesn't show a custom object or field that was recently created, close and reopen it.
If a user leaves a choice blank or unselected, its stored value is set to null.
If you have the same choice option used in more than one place on different screens in your flow, a was selected query on
that choice option will always resolve to the most recent one.
If you have the same choice option with a user input used in more than one place on the same screen, a was selected query
on that choice option will always resolve to the first one.
Dont enter the string null as the value of a text field in the Cloud Flow Designer. If you do this, you may not be able to
save the flow.
The Cloud Flow Designer cant open flows installed from managed packages.
If you open a flow from Winter 12, any Boolean decision it contains is converted to a multi-outcome Decision element
that:
Uses the same name as the old decision.
Takes the unique name of the old decision, appended with _switch.

55

Visual Workflow Considerations

Has an outcome labeled True. This outcomes unique name matches that of the old decision, and its conditions are
migrated from the True outcome of the old decision.
Has a default outcome labeled False.

Flow Administration

Only files with the .flow extension can be uploaded into Salesforce. To convert .spark files into .flow files, download
the latest version of the Flow Designer from the flow list page, open your file, and save it with the .flow extension.
Note: Desktop Flow Designer files with the .flow extension are different from and are incompatible with the
.flow files that are generated by the Metadata API for flows created from the Cloud Flow Designer.

If you exceed your organization's site usage limits or Visualforce usage limits, you can't run flows.
Once you edit the name and description of your flow in Salesforce, those fields no longer automatically update when you
upload or activate a new version.
When you activate a new version of a flow, the previously activated version (if one exists) is automatically deactivated. Flow
processes currently running continue to run using the version with which they were initiated.
You cant delete an active flow. Once deactivated, you must wait 12 hours to delete a flow or flow version. This ensures that
flows in progress have time to complete. Flows that have never been activated can be deleted immediately.

Flow Runtime

Don't use your browser's Back or Forward buttons to navigate through a flow. This may result in inconsistent data between
the flow and Salesforce.
A single flow may have up to 50 different versions. When you run a flow, you see the active version, which may not necessarily
be the latest version.

56

Chapter 10
Visual Workflow Accessibility Overview
Available in: Enterprise, Unlimited, and Developer Editions

Visual Workflow is 508-compliant with the following exceptions:

Clicking the next or previous buttons doesn't change the title of the screen, so you may not realize you're on a new page.
There are no labels on radio buttons. Screen readers can't distinguish between questions.
Questions without defined prompts may not read correctly.
Errors are not noted when reading the fields.

57

Chapter 11
Visual Workflow Terminology
Available in: Enterprise, Unlimited, and Developer Editions

The following terminology is used for Visual Workflow in Salesforce:


Element
Elements are the building blocks of flows. Each element represents an action, such as presenting information to, or
collecting information from, flow users, or even querying, creating, updating, and deleting information in Salesforce. By
connecting elements together in the Flow Designer, you can create a flow, which is a series of screens, inputs, and outputs
through which users navigate.
Flow
A flow starts out as a process or decision diagram created in the Flow Designer. Once uploaded and run in Salesforce, it
becomes an application for navigating users through a series of screens.
Cloud Flow Designer
Cloud-based application that lets administrators create a flow for use in Salesforce.
Desktop Flow Designer
Desktop application that allows administrators to create a flow for use in Salesforce.
Master Flow
A master flow is a flow that contains a subflow element. The term master is used to distinguish it from the flow that is
referenced and called by the subflow element.
Resource
Resources, such as variables, constants, or formulas, allow you to store or manipulate data and use it throughout your flow.
Subflow
A subflow element references another flow, which it calls at runtime. The flow that contains the subflow element is referred
to as the master flow.

58

APPENDICES

Appendix

A
Tutorial #1: Creating a Tip Calculator
If you're new to flows and the Flow Designer, this tip calculator tutorial is a simple introduction to the basic elements of a flow
and how they work together.

Optional Step: Pre-configure Your Flow Using Step Elements


A Step is a placeholder element you can use to quickly sketch out a draft of a new flow or make conceptual changes to an
existing flow. Once you have your flow set up using Steps, you can then convert them into Screens or replace them with other
elements.
In this step, well pre-configure the tip calculator flow using Step elements.
When thinking about how to draft our tip calculator flow, we know we need to do two things for the users: give them a place
to enter the bill amount and service quality, then show them the recommended tip amount. Lets start with those.
1. Go to Your Name > Setup > Create > Workflow & Approvals > Flows.
2. Click New Flow.
3. From the Palette in the left pane, click and drag a Step element onto the canvas.
4. Enter Bill Information Step into the Name field.
5. Press TAB, and the Unique Name field should automatically fill in.
6. In the Description field, enter Capture bill amount and service quality.
7. Click OK.
8. From the Palette in the left pane, click and drag another Step element onto the canvas, beneath the first one.
9. Enter Tip Amount Step into the Name field.
10. In the Description field, enter Display tip amount.
11. Click OK.
12. Click and drag an arrow connector from the bottom of the Bill Information Step onto the Tip Amount Step.

59

Appendix A: Tutorial #1: Creating a Tip Calculator

Step 1: Add a Screen Element to Capture the Bill Information

From the users perspective, all we need are two screens, representing input (bill amount, service quality) and output (tip
amount). However, at least one thing needs to happen that the user will never see: the calculation of the tip amount. Well
use a Formula resource for that later on.
Note: Steps aren't valid elements for active flows. You can have a draft flow with Steps in it and can run it in the draft
state as an administrator, but you must replace the Steps with other elements before you can activate the flow and let
users run it.

Step 1: Add a Screen Element to Capture the Bill Information


In the first screen of the flow, well ask the user to input the bill amount and rate the level of service they received.
If you bypassed the optional step to pre-configure your flow with Step elements:
1.
2.
3.
4.
5.

Go to Your Name > Setup > Create > Workflow & Approvals > Flows.
Click New Flow.
From the Palette in the left pane, click and drag a Screen element onto the canvas.
Enter Bill Information into the Name field.
Press TAB, and the Unique Name field should automatically fill in.

If you did the optional step to pre-configure your flow with Step elements, we need to convert the Step into a Screen.
1. Hover over the Bill Information Step and click .
2. Remove Step from the Name field. It should just read Bill Information now.
3. Remove _Step from the Unique Name field. It should just read Bill_Information now.
The first thing we want to gather on the screen is the bill amount, so we need to add an input field for it.
1.
2.
3.
4.
5.

Click the Add a Field tab.


Double-click to add a Currency field. A blank currency field appears in the right preview pane.
Click the currency field in the preview pane to configure it.
On the Field Settings tab, enter Bill Amount in the Label field.
Enter 2 into the Scale field. The scale is the maximum number of digits allowed to the right of the decimal point. This
number can't exceed 17. If you leave this field blank or set to zero, only whole numbers are displayed when your flow runs.
6. Make the field required.
The next thing we want to know is how the user rated their service, so we need a choice input field.
1.
2.
3.
4.
5.
6.
7.

Click the Add a Field tab again.


Double-click to add a set of radio buttons.
Click the radio button field in the preview pane.
On the Field Settings tab, enter Quality of Service in the Label field.
Set Value Data Type to Number, because well be storing the service level choice as a number representing tip percentage.
Enter 2 into the Scale field.
Make the field required.

In the Choice Settings section, we need to set up four service level choices for the user. Choices are resources, and we can
create them here in the Screen overlay.

60

Appendix A: Tutorial #1: Creating a Tip Calculator

1.
2.
3.
4.
5.
6.

Step 2: Create Formulas to Calculate Tip Amount and Total Bill

Click the arrow button to the right of the first Choice field, expand the CREATE NEW section, and select Choice.
In the Label field, type Excellent.
Set the Value Data Type to Number.
For Stored Value, enter 20, representing a 20% tip.
Click OK.
Click Add Choice to repeat these steps three more times, adding new choices with the following values.

Label: Good; Stored Value: 15


Label: Fair; Stored Value: 10
Label: Poor; Stored Value: 0

7. Verify that your Screen overlay looks like this, then click OK.

Step 2: Create Formulas to Calculate Tip Amount and Total Bill


To calculate the tip amount and the total bill, we need to create two formulas. The tip amount is based on the bill amount
and service quality. The total bill adds together the bill amount and the result of the tip amount calculation.

Calculate the Tip Amount


The tip amount is the bill amount multiplied by the service quality value as a percentage. When setting up our screen in Step
1, we gave the Quality of Service choices numeric stored values, which correspond to tip percentages. Well set up this
formula to automatically calculate how much tip should be given based on what level of service quality the user chose.
1.
2.
3.
4.

Click on the Resources tab.


Double-click the Formula resource.
Enter TipAmount for Unique Name.
Enter 2 into the Scale field. The scale is the maximum number of digits allowed to the right of the decimal point. This
number can't exceed 17. If you leave this field blank or set to zero, only whole numbers are displayed when your flow runs.

61

Appendix A: Tutorial #1: Creating a Tip Calculator

Step 2: Create Formulas to Calculate Tip Amount and Total Bill

5. Click the arrowhead button, expand the SCREEN INPUT FIELDS section and select Bill_Amount. You should see
{!Bill Amount} appear in the text box.
6. We want to multiply the bill amount by the service quality value, so after {!Bill Amount}, type an asterisk.
7. Put your cursor directly after the asterisk, click the arrowhead button, expand the SCREEN CHOICE FIELDS section,
and select Quality_of_Service.
8. Since we want to represent the service quality as a percentage, type /100 after {!Quality_of_Service}, then enclose
both in parentheses, like so: ({!Quality_of_Service}/100).
9. Your final formula should look like this: {!Bill Amount}*({!Quality_of_Service}/100).

10. Click OK.


If you click the Explorer tab, you should now see TipAmount under the FORMULAS section.

Calculate the Total Bill


The total bill is the sum of the TipAmount formula plus the bill amount value the user entered in the first screen.
1. From the Resources tab, double-click the Formula resource again.
2. Enter TotalBill for Unique Name.
3. Enter 2 into the Scale field. The scale is the maximum number of digits allowed to the right of the decimal point. This
number can't exceed 17. If you leave this field blank or set to zero, only whole numbers are displayed when your flow runs.
4. Click the arrowhead button, expand the SCREEN INPUT FIELDS section and select Bill_Amount. You should see
{!Bill Amount} appear in the text box.
5. We want to add the bill amount and tip amount together, so after {!Bill Amount}, type a plus sign (+).
6. Put your cursor directly after the plus sign, and using the arrowhead button, expand the FORMULAS section, and select
TipAmount.
7. Your formula should look like this: {!Bill Amount}+{!TipAmount}.

62

Appendix A: Tutorial #1: Creating a Tip Calculator

Step 3: Add a Screen to Display the Results

8. Click OK.
If you click over to the Explorer tab again, you should now see TipAmount and TotalBill in the Formulas section.

Step 3: Add a Screen to Display the Results


Weve created the formulas to calculate tip amount and total bill amount, and next we need to display those back to the user.
To do this, well set up another Screen element.
If you bypassed the optional step to pre-configure your flow with Step elements:
1. From the Palette in the left pane, click and drag a Screen element onto the canvas.
2. Enter Show Tip Summary into the Name field.
3. Press TAB, and the Unique Name field should automatically fill in.
If you did the optional step to pre-configure your flow with Step elements, we need to convert the second Step into a Screen.
1. Hover your mouse over the Tip Amount Step and click .
2. Change the Name field to Show Tip Summary.
3. Change the Unique Name field to Show_Tip_Summary.
Now we can configure the fields for the Screen.
1.
2.
3.
4.
5.

Click the Add a Field tab.


Double-click to add a Display Text field.
Click the Display Text field in the preview pane.
On the Field Settings tab, enter TipSummary for the unique name.
In the text box, type: You say the quality of service was X, so you should leave a tip of Y
for a total bill of Z. Well replace X, Y, and Z with values from the flow.
a. Click the arrowhead next to the Select resource field.
b. Expand the SCREEN CHOICE FIELDS section and select Quality_of_Service.
c. Replace the X in the sentence with {!Quality_of_Service}.

63

Appendix A: Tutorial #1: Creating a Tip Calculator

d.
e.
f.
g.

Step 3: Add a Screen to Display the Results

Click the arrowhead again, expand the FORMULAS section, and select TipAmount.
Replace the Y in the sentence with {!TipAmount}.
Click the arrowhead again, expand the FORMULAS section, and select TotalBill.
Replace the Z in the sentence with {!TotalBill}.

The final text in the preview pane of the overlay should look like this:
You say the quality of service was {!Quality_of_Service}, so you should leave a tip of
{!TipAmount} for a total bill of {!TotalBill}.

6. Verify your Screen overlay looks like this, then click OK.

7. If you didnt already do it in the optional first step, click and drag an arrow connector from the Bill Information screen
element onto the Show Tip Summary screen element.
Tip: If you accidentally delete a selected element or connector from the canvas, dont panic! Go up to the button bar
and click Undo (

). If you undo too many changes, click Redo (

).

Your Flow Designer main canvas should contain two Screen elements, as shown here.

64

Appendix A: Tutorial #1: Creating a Tip Calculator

Step 4: Save the Flow

Step 4: Save the Flow


OK, we're done setting up our flow! Now we need to save it.
1.
2.
3.
4.
5.

Click Save on the button bar.


Enter Calculate Tip in the Name field.
Press TAB, and the Unique Name field should automatically fill in.
Enter a description if you like.
Click OK.

You may have noticed this message on the Save dialog:

All flows must have an element designated as the start point. Let's do that now.
1. If you didn't already, click OK to close the save dialog box.
2. Hover your mouse over the Bill Information screen element and you'll see three icons appear in the upper right corner.

3. Click to set the Bill Information screen as the starting point for the flow.
4. Click Save again to save this change.
5. Click Close. You should be taken to the flow detail page.

Step 5: Run the Flow


We've created and saved our flow, now let's run it to make sure everything works correctly. We'll fill it out as a user would,
using some sample numbers.
1. From the flow detail page, click either the Run button at the top of the page, or the Run link in the Action column. The
flow should open up in a new window.
2. In the Bill Amount field, enter 100.00.
3. For Quality of Service, select Excellent.

65

Appendix A: Tutorial #1: Creating a Tip Calculator

Step 5: Run the Flow

4. Click Next.
5. The next screen should read: You say the quality of service was Excellent, so you should leave a tip of 20.00 for a total bill
of 120.00.

6. Click Finish.
7. Close the flow window.

66

Appendix

B
Tutorial #2: Creating a Sustainability Survey
This tutorial is slightly more complex than the Tip Calculator. This time well create a flow for a company that wants to find
out the commute habits of its employees. Using a combination of display text, textboxes, and radio buttons, well capture
employees regions, commute hours, and email addresses. Were going to ask them to identify their region in the first screen,
then well use a Decision element and a series of Screen elements to route them through the flow based on which region they
choose.

Step 1: Add a Screen Element to Capture Users Region


The first screen in the flow will introduce the survey and ask users what region they work in. So, well need to display some
text and present users with a choice.
1. Go to Your Name > Setup > Create > Workflow & Approvals > Flows.
Tip: If you completed the Tip Calculator flow, youll see it here on the flow list page. In the Actions column, the
Edit link lets you edit the flow properties, such as its name and description. The Open link opens the flow in the
Flow Designer. Clicking the flow name takes you to the flow detail page.
2.
3.
4.
5.

Click New Flow.


From the Palette in the left pane, click and drag a Screen element onto the canvas.
Enter Welcome to the Sustainability Survey into the Name field.
Press TAB, and the Unique Name field should automatically fill in.

The first thing we want to do on this screen is to welcome the user and tell them a little bit about the survey.
1.
2.
3.
4.
5.

Click the Add a Field tab.


Double-click Display Text. A display text field appears in the preview pane.
Click the display text field to configure it.
On the Field Settings tab, enter SurveyIntro in the Unique Name field.
In the text box, type in Thank you for spending the next seven minutes on this commute survey.
Your participation will help us assess our environmental footprint as a company and
help us plan better transportation options as we grow. At the end of the survey,
enter your email address for the chance to win a $250 gift card! One winner will be
chosen at random.

Next, well ask users to identify which region they work in.

67

Appendix B: Tutorial #2: Creating a Sustainability Survey

1.
2.
3.
4.
5.

Step 2: Add and Configure a Decision Element

Click back over to the Add a Field tab.


Under the CHOICES section, double-click Radio Buttons.
Click the Radio Button field in the preview pane.
On the Field Settings tab, enter In which region do you work? in the Label field.
In the Choice Settings section, we need to set up two region choices for the user. Choices are resources, and we can create
them here in the Screen overlay.
a.
b.
c.
d.
e.
f.
g.
h.
i.

Click the arrow button to the right of the first Choice field, expand the CREATE NEW section, and select Choice.
In the Label field, type AMERICAS.
For Stored Value, enter AMERICAS.
Click OK.
Click Add Choice
Click the arrow button to the right of the new Choice field, expand the CREATE NEW section, and select Choice.
In the Label field, type EMEA.
For Stored Value, enter EMEA.
Click OK.

6. Verify that your Screen overlay looks like this, then click OK.

Step 2: Add and Configure a Decision Element


You may be wondering why we need a Decision element, since we set up a set of radio buttons in the last screen for the user
to choose their region. The Decision element is what provides the logic behind the scenes to direct users down a branch of
the flow based upon the choices they make. Users wont see it.
For our example, we have only two choices, AMERICAS or EMEA, so we can set the decision to a simple Boolean outcome:
true or false. Well set AMERICAS as the True path, so by default, any user choosing EMEA will travel down the False
path of the flow.

68

Appendix B: Tutorial #2: Creating a Sustainability Survey

Step 3: Add a Screen Element for the AMERICAS Option

1. From the Palette tab, click and drag a Decision element onto the canvas directly below the Screen you just created.
2. Enter Route based on region for Name.
3. In the Outcomes section, well configure the conditions for each outcome.
a.
b.
c.
d.
e.

For Name, enter Region: AMERICAS


In the Resource field, click and expand the CHOICES section and select AMERICAS.
Select was selected for the operator.
In the Value field, click and expand the GLOBAL CONSTANT section and select $GlobalConstant.True.
Click [Default Outcome]. The default outcome defines a path to which users will be routed if none of the other
outcome conditions are met. Since our decision is a simple Boolean one, and weve already set our True path
(AMERICAS), we can use the default outcome as our False path.
f. For Name, enter Region: EMEA.
4. Verify that your Decision overlay looks like this, and click OK.

5. Click and drag an arrow connector from the Screen element onto the new Decision element.

Step 3: Add a Screen Element for the AMERICAS Option


We have two outcomes for our Decision element, so we need to set up two Screen elements asking the user for input based
on which region they chose: one for AMERICAS and one for EMEA. In this step, well create the AMERICAS Screen
element.
1. From the Palette in the left pane, click and drag a Screen element onto the canvas.
2. Enter Office and Commute Days into the Name field.
3. Change the Unique Name field to Get_Office_and_Commute_Days_AMERICAS.
We need two different bits of information from the user: what office theyre in, and the number of days they commute to
work. First well ask for their office location.

69

Appendix B: Tutorial #2: Creating a Sustainability Survey

1.
2.
3.
4.
5.
6.

Step 3: Add a Screen Element for the AMERICAS Option

Click the Add a Field tab.


Under the CHOICES section, double-click to add a set of radio buttons.
Click the Radio Buttons field in the preview pane to configure it.
On the Field Settings tab, enter Office Location in the Label field.
Change the Unique Name to Office_Location_AMERICAS.
In the Choice Settings section, we need to set up three region options for the user. Choices are resources, and we can create
them here in the Screen overlay.
a.
b.
c.
d.
e.

Click the arrow button to the right of the first Choice field, expand the CREATE NEW section, and select Choice.
In the Label field, type US: San Francisco.
For Stored Value, enter SF.
Click OK.
Click Add Choice to repeat these steps two more times, adding new choices with the following values.

Label: US: New York; Stored Value: NY


Label: US: Washington DC; Stored Value: DC
Tip: After you create them, choices show up on the Explorer tab. If you need to go back and edit something in a
choice, click the Explorer tab, then double click the choice you need to modify.

Next, well ask users to tell us how many days they commute to work every week.
1.
2.
3.
4.
5.
6.

Click back over to the Add a Field tab.


Under the INPUTS section, double-click to add a Textbox.
Click the Textbox field in the preview pane.
On the Field Settings tab, enter How many days a week do you commute to work? in the Label field.
Change the unique name to Number_of_Days_AMERICAS.
Verify that your Screen overlay looks like this, then click OK.

70

Appendix B: Tutorial #2: Creating a Sustainability Survey

Step 4: Add a Screen Element for the EMEA Option

7. Click and drag an arrow connector from the Decision element onto this Screen element. A Decision Routing dialog box
appears.
8. Make sure Region: AMERICAS is selected, then click OK. A connector labeled as Region: AMERICAS should appear
between the Decision and the Screen we just created.

Step 4: Add a Screen Element for the EMEA Option


We created the Screen element for the AMERICAS choice path, now we need to create the EMEA Screen element.
1. From the Palette in the left pane, click and drag a Screen element onto the canvas.
2. Enter Office and Commute Days into the Name field.
3. Change the Unique Name field to Get_Office_and_Commute_Days_EMEA.
Again, we need two different bits of information from the user: what office theyre in, and the number of days they commute
to work. First well ask for their office location.
1.
2.
3.
4.
5.
6.

Click the Add a Field tab.


Under the Choices section, double-click to add a set of radio buttons.
Click the Radio Buttons field in the preview pane to configure it.
On the Field Settings tab, enter Office Location in the Label field.
Change the unique name to Office_Location_EMEA.
In the Choice Settings section, we need to set up three region options for the user.
a.
b.
c.
d.
e.

Click the arrow button to the right of the first Choice field, expand the CREATE NEW section, and select Choice.
In the Label field, type UK: London.
For Stored Value, enter UK.
Click OK.
Click Add Choice to repeat these steps two more times, adding new choices with the following values.

Label: France: Paris; Stored Value: FR


Label: Spain: Madrid; Stored Value: SP

Next, well ask users to tell us how many days they commute to work every week.

71

Appendix B: Tutorial #2: Creating a Sustainability Survey

1.
2.
3.
4.
5.
6.

Step 4: Add a Screen Element for the EMEA Option

Click back over to the Add a Field tab.


Under the INPUTS section, double-click to add a Textbox.
Click the Textbox field in the preview pane.
On the Field Settings tab, enter How many days do you commute to work? in the Label field.
Change the unique name to Number_of_Days_EMEA.
Verify that your Screen overlay looks like this, then click OK.

7. Click and drag a connector from the Decision element onto this new Screen element.
Because you already set up the path pointing to the AMERICAS Screen, the Flow Designer knows that the second connector
coming out from the Decision element should automatically be labeled as Region: EMEA. Your diagram should look similar
to this now:

72

Appendix B: Tutorial #2: Creating a Sustainability Survey

Step 5: Collect Commute Information

Step 5: Collect Commute Information


The next set of information we need to collect from each user is how long they spend commuting each day and how much
their commute costs them, in both time and money.
1. From the Palette in the left pane, click and drag a Screen element onto the canvas.
2. Enter Detailed Commute Information into the Name field.
3. Change the Unique Name field to Get_Detailed_Commute_Information.
We need three different types of information from the user. First, well ask how long their round-trip commute is, in miles.
1.
2.
3.
4.
5.

Click the Add a Field tab.


Under the INPUTS section, double-click to add three Textbox fields.
Click the first Textbox field in the preview pane to configure it.
On the Field Settings tab, enter How long is your commute, round-trip? in the Label field.
Change the unique name to Distance.

6. Expand the Help Text section. Text you enter here displays in an information tooltip as a help icon ( ) to the right of
the field. When the user clicks the icon during runtime, the help text appears.
7. Type in Enter the distance in miles.
Next, well ask how long they spend commuting each day.
1.
2.
3.
4.
5.

Click the second Textbox field in the preview pane.


On the Field Settings tab, enter How long does your commute take, round-trip? in the Label field.
Change the unique name to Time.
Expand the Help Text section.
Type in Enter the time in hours.

Lastly, well ask how much they spend on commute expenses every month.
1. Click the third Textbox field in the preview pane.
2. On the Field Settings tab, enter How much do you spend on your commute every month? in the Label
field.
3. Change the unique name to Cost.
4. Expand the Help Text section.
5. Type in Enter the amount in your local currency.
6. Verify that your Screen overlay looks like this, then click OK.

73

Appendix B: Tutorial #2: Creating a Sustainability Survey

Step 6: Collect Email Address

7. Click and drag a connector from the both the Americas and EMEA Screen elements onto this Screen element.

Step 6: Collect Email Address


The final bit of information we want to collect from our users is their email address, so we can enter them into a raffle for a
gift card.
1. From the Palette in the left pane, click and drag a Screen element onto the canvas.
2. Enter Enter Your Email for Raffle into the Name field.
3. Change the Unique Name field to Get_Email_for_Raffle.
4. Click the Add a Field tab.
5. Under the OUTPUTS section, double-click to add Display Text.
6. Click the Display Text field in the preview pane to configure it.
7. On the Field Settings tab, enter EmailHeader in the Unique Name field.
8. In the text box, type in Enter your email address for the chance to win a $250 gift card!
9. Click back over to the Add a Field tab.
10. Under the INPUTS section, double-click to add a Textbox.
11. Click the Textbox field in the preview pane to configure it.
12. On the Field Settings tab, enter Email Address in the Label field.
13. Press TAB to fill in the Unique Name field.
14. Verify that your Screen overlay looks like this, then click OK.

74

Appendix B: Tutorial #2: Creating a Sustainability Survey

Step 7: Thank the Respondents

15. Click and drag a connector from the previous Screen element onto this one.

Step 7: Thank the Respondents


Youve collected all the information you needed, but lets thank your employees for taking the time to take the survey.
1.
2.
3.
4.
5.
6.
7.
8.
9.

From the Palette in the left pane, click and drag a Screen element onto the canvas.
Enter Thank You into the Name field.
Change the Unique Name field to Summary_and_Finish.
Click the Add a Field tab.
Under the OUTPUTS section, double-click to add Display Text.
Click the Display Text field in the preview pane to configure it.
On the Field Settings tab, enter Summary in the Unique Name field.
In the text box, type in Thank you for participating in the survey!
Verify that your Screen overlay looks like this, then click OK.

75

Appendix B: Tutorial #2: Creating a Sustainability Survey

Step 8: Save the Flow

10. Click and drag a connector from the previous Screen element onto this one.
Your completed flow diagram should now look something like this:

Step 8: Save the Flow


OK, were done setting up our flow! Now we need to save it.
1.
2.
3.
4.

Click Save on the button bar.


Enter Sustainability Survey in the Name field.
Press TAB, and the Unique Name field should automatically fill in.
Enter a description if you like.

76

Appendix B: Tutorial #2: Creating a Sustainability Survey

Step 9: Run the Flow

5. Click OK.
You may have noticed this message on the Save dialog:

All flows must have an element designated as the start point. Lets do that now.
1. Hover your mouse over the first screen element and youll see icons appear in the upper right corner.
2. Click to set the welcome screen as the starting point for the flow.
3. Click Save again to save this change.
4. Click Close. You are taken to the flow detail page.

Step 9: Run the Flow


We've created and saved our flow, now let's run it to make sure everything works correctly. We'll fill it out as a user would,
using some sample data.
1. From the flow detail page, click either the Run button at the top of the page, or the Run link in the Action column. The
flow opens up in a new window.
2. Select AMERICAS.
3. Click Next.
4. Select US: New York.
5. Enter 3 for the number of days you commute to work.

77

Appendix B: Tutorial #2: Creating a Sustainability Survey

Step 9: Run the Flow

6. Click Next.
7. For the next screen, indicate that your commute is 30 miles, takes 1 hour round-trip, and that you spend $71.40 on your
commute every month.

8. Click Next.
9. Enter an email address.
10. Click Next.
11. Click Finish.
12. Close the flow window.

78

Index

Index
A
About Apex Plug-ins 29
About formulas in flows 36
About subflows 25
Activating a flow 44
Apex Plug-in element 28
Assignment element
adding 30
configuring 30

C
Choice 38
Connector element 30
Constant 34
Creating a Flow 10

D
Decision element
adding 19
configuring 19
Deleting a flow 44
Dynamic Choice 39

E
Editing flow properties 46
Elements
adding 13
Apex plug-in 2829
assignment 30
connector 30
decision 19
editing 13
fault connector 31
managing 13
record create 22
record delete 24
record lookup 20
record update 23
removing 13
screen 1418, 3839
step 13
subflow 25

F
Fault Connector element 31
flow
activating 44
deleting 44
managing 44
opening 44
Flow
accessibility 57
administration 43
creating 10
delivering to users 47
editing properties 46

Flow (continued)
embedding in Visualforce pages 47
in change sets 52
in packages 52
limits 54
running flows 51
saving 10
sharing 47
using 47
Flow Designer
editing flow properties 8
element comparison 5
elements 12
functionality comparison 5
resources 33
saving flows 8
system requirements 4
user interface 8
using 4
Flows in change sets 52
Flows in packages 52
Formula resource 36

G
Global constants 41

L
Limits
flow 54

O
Opening a flow 44

R
Record Create element 22
Record Delete element 24
Record Lookup element 20
Record Update element 23
Resources
choice 38
constant 34
dynamic choice 39
formula 36
global constants 41
text template 37
variable 34
variable in referenced flow 27

S
Saving a flow 10
Screen element
Add a Field tab 15
adding 14
configuring a choice 38
configuring a dynamic choice 39

79

Screen element (continued)


configuring choice fields on the Field Settings tab 17
configuring output fields on the Field Settings tab 18
configuring the Field Settings tab 1518
configuring the General Info tab 14
configuring user input fields on the Field Settings tab 16
editing 14
settings 1418, 3839
Setting a start element 13
Step element 13
Subflow element 25

Index

Variable 34
Variable in referenced flow 27
Visual Workflow
considerations 55
setting finish behavior 49
tips and tricks 55
Visual Workflow overview 3
Visualforce
embedding flows 4748

T
Text Template 37

80

You might also like