Some of the functionality described in this article is available as part of our Zinfandel release and will not be available if your Practifi instance is not upgraded to this release. |
Please note: This content is intended for Practifi System Administrators and is technical in nature. The steps described in this article may not be able to be completed without System Administrator permissions. |
Overview
As of the Cabernet Franc release of February 2024, Salesforce's Flow Builder is available as an alternative way to build Active Forms. Flow Builder is Salesforce’s premier process automation tool. When adding an Active Form to a Task Template or Process Task, you have the option of using Form Elements, as outlined in our Configuring Active Forms article, or Flow Builder.
This article does not cover the complete process of building a Flow. It is intended as a resource to provide recommendations and best practices for using Screen Flows in conjunction with Active Forms.
- Flow Builder Capabilities
- Form Elements vs. Flow Builder
- Accessing Flow Builder in Practifi
- Overriding Practifi Flows
- Adding a Flow to an Active Form
-
Flow Builder Best Practices
- Pull Data from the Task Record
- Link Your Flow to the Task
- Map Flow Data to Workflow Actions
- Populating Previously Entered Values
- Adding Tables to Flows
- End User Experience
- Making Required Fields
- Including a Flow in the Start a Process and New Task (from template) Actions
- Using Flow Builder Forms in Portals
- Error Handling
- Displaying Flow Inputs on Completed Tasks
- Flow Builder Validation Check
- Flow Builder Considerations
- Flow Builder Resources
Flow Builder Capabilities
Screen Flows in Flow Builder have several advantages, including:
- Performing actions automatically while progressing through form screens
- Looping through the same screen multiple times to perform multiple actions
- Additional UI elements, such as dependent picklists, sliders and toggle switches
- Support for the wide range of Flow Screen Components available from the Salesforce AppExchange and other third-party sources
- Extensive testing and debugging capabilities
Form Elements vs. Flow Builder
When deciding whether to build an Active Form using Form Elements or Flow Builder, here are some factors to keep in mind:
Consider using Form Elements if... | Consider using Flow Builder if... |
You're familiar with Form Elements | You have experience building Flows |
You know there is a direct solution with Form Elements | The desired outcome is easier to achieve with Flows |
Your planned Active Form is simple | Your Active Form requires something not possible with Form Elements |
Pinned Fields are needed | You do not need to use Pinned Fields |
Accessing Flow Builder in Practifi
Active Forms are compatible with Screen Flows. If you have not already done so, we recommend consulting the resources listed at the end of this article to familiarize yourself with Flow Builder.
To access Flow Builder in Practifi:
- Open Salesforce Setup by selecting the gear icon in the upper right-hand corner of the screen and selecting Setup from the drop-down menu.
- In Salesforce Setup, use the Quick Find search bar to search for and select Flows.
- On the Flows page, click the New Flow button in the upper right-hand corner of the screen. Flow Builder opens in a new tab.
- In the New Flow window, confirm that the Screen Flow option is selected, then select Create.
- You have the option of using Update Records elements in the Flow to execute actions like updating fields, or you can use the Active Form variables and field assignments in the Process Task to pass values from the Flow to the Active Form with actions like Save to Related Record.
- After building the Screen Flow and saving your work, copy the value in the Flow API Name field. You will need this to connect the Flow to the Active Form. You can access this information by clicking the gear icon at the top of the Flow Builder screen.
Please note: Per our Flow Builder Best Practices, your Screen Flow should include a text variable called taskId enabled for input. This allows the Screen Flow to retrieve data from the Task record where the Active Form is embedded.
Overriding Practifi Flows
The following Practifi Flows are overridable, meaning you can use Save As to create a new version and modify them if needed:
- Change Event Received
- Practifi - Add Account to Campaign
- Practifi - Add Contact to Campaign
- Practifi - Convert Contact to Individual
- Practifi - Mass Action - Edit Records
- Practifi - Mass Action - Service Type - Create Deliverables
- Practifi - Mass Action - Task - Change Status
- Practifi - Mass Action - Update Household Name
- Practifi - New Record - Process
- Practifi - Record Action - Add Setup Bundle
- Practifi - Record Action - Deep Clone Process Type
- Practifi - Record Action - Deep Delete
- Practifi - Record Action - Save to Setup Bundle
- Practifi - Record Action - Task - Complete.
- Practifi - Relate to Person
Please note: To preserve version control, the original Flow will be retained as an inactive one. Any future product updates to the original pre-packaged Practifi Flows will not apply to modified Flows
To create a new version of a Flow in Practifi:
- Open Salesforce Setup by selecting the gear icon and selecting Setup from the drop-down menu.
- In Salesforce Setup, use the Quick Find to search for and select Flows.
- On the Flows page, click the hyperlinked name of the Flow you want to use.
- At the top of the screen, click Save As.
- In the Save As Flow Override window, enter a Flow Label and Flow API Name, then click Save.
Adding a Flow to an Active Form
When adding an Active Form to a Process Task, the Configure this task’s Active Form with picklist allows you to select either Form Elements (the existing configuration method) or Flow Builder.
Selecting Flow Builder hides the Active Form Screens, Sections, Fields, Tables and other records that typically appear in the Active Form tab and replaces them with the objects required to configure an Active Form using Flow Builder:
- Active Form Flow - Each entry in this object represents a Screen Flow that appears on the Task record page.
- Active Form Variable - Each entry in this object represents a variable from the Flow that you want to use outside of the Flow, e.g., as a field in the action that creates the next task in the workflow.
Flow Builder Best Practices
The following are recommendations for setting up Flows for use in Active Forms in Practifi.
Pull Data from the Task Record
If you want your Flow to pull in values from the Task record it’s located within, make sure to include a text variable named taskId that’s been enabled for input.
This variable will be automatically populated with the Task’s record ID when the Flow is run within the workflow, meaning you can use that variable as the basis for retrieving field values from the Task and its related records, much like prefilling works with Elements-based forms today.
Link Your Flow to the Task
Ensure you’ve created and saved the Screen Flow you wish to use before proceeding to this step and that you’ve copied its API Name.
Create an Active Form Flow record to link your Flow to the workflow task. While doing so, you’ll configure these settings:
- API Name - Paste the API Name of the Flow you saved into this field.
- Active - Toggle this on or off, depending on whether you want the Flow to become immediately available to your users. We recommend leaving this turned off until you’ve completed and validated all your Flow Builder and workflow task configurations.
-
Appears in - Use this field to determine whether you want the Flow to appear within the workflow’s launch action, on the Task record page or in both places. For more information, please see Including a Flow in the Start a Process and New Task (from template) Actions.
Set the Appears in field to "Completed task record pages" to allow users to view data captured in flow-based Active Forms after the Task has been completed. As a best practice, we suggest including contextual questions or field names to help users understand what data they're viewing:- Integrate the question or field name related to the answer within the Screen Flow.
- Configure the setup to map the captured values with appropriate labels or questions.
For example, when capturing different fields such as a date, a picklist value or a text field, configure the Flow to display something along the lines of:
- Birthday: [captured date]
- Source: [captured picklist value]
- First Name: [captured text field value]
This approach ensures that the output clearly indicates what each piece of data represents, making the information more accessible and understandable.
- Allow restarts when there’s an error? - Toggle this on or off depending on whether you want to show a Restart button if the Flow encounters an error. For more information, please see Error Handling.
Once you’ve created the Active Form Flow record, you’ll have the option of defining visibility rules for it using the Rule Builder on the record page. This is useful in scenarios where you want to show different forms to different users, such as when a workflow task could be actioned either by an employee or an end investor using a portal.
Only one Screen Flow will appear on-screen at any one time. If settings and visibility rules are configured such that two or more should appear, the most recently modified Active Form Flow record will determine which Screen Flow is displayed.
Map Flow Data to Workflow Actions
If you want to pull data from a Screen Flow into one of the workflow engine’s native actions, there are a few steps to perform.
First, you’ll need to make that data point available as a variable within Flow Builder. Flow variables are explained in detail by Salesforce in this Trailhead module. You'll need to specify the variable as both Available for input and Available for output in the Availability Outside the Flow section of the variable’s settings.
Next, create an Active Form Variable record from the Process Task record page by doing the following:
- Click the New Variable button.
- In the Variable Name field, enter the API Name of the variable you’re making available outside of the Flow.
- Click Save.
Please note: Active Form Variables are not mapped to Active Form Flows. When a Screen Flow associated with the Process Task searches for a variable, they all reference the same Active Form Variable record.
Once the Active Form Variable has been created, Flow variables are mapped to Action records similarly to Active Form Fields using the Active Form Assignment object.
Collection variables are supported in Flow Builder in a limited way. They can save a string of comma-separated values to a text field or as genuine record references to a multi-record lookup field, but they can’t be used for anything else, such as to execute a copy of the action for every record in the collection.
Populating Previously Entered Values
If a user fills out an Active Form and navigates away from the Task without marking it complete, the values entered in the Flow Interview can be lost. Using variables and formulas, you can retain values a user entered in a previous session and bring them into the Flow. Here are some things to keep in mind:
- If you are prefilling the Screen fields with values from records, place a Get Records element at the start of your Flow. Use this to get the Task record where the Id equals taskId.
- If you would like to prefill the information on the Screen with data from another object, you will need another Get Records element. This can pull from multiple objects related to your task record.
- For example, to pull information from the Task’s Related Entity, add a Get Records element where the Id equals the {!Get_Task.practifi__Related_Entity__c}
- Create a variable for each field in the Screen Flow.
- Example: {!BillingCity}, Type = Text, Available for Output = True
- Create a formula for each variable.
- Example: BillingCityFormula, Type = Text, Formula = BLANKVALUE({!BillingCity}, {!Get_Account.BillingCity})
- Assign the ‘Original Values’ to each variable.
- Example: {!BillingCity} = {!BillingCityFormula}
- When prefilling the screen elements, use the text variable as the prefill value.
- Example: Element label = ‘Billing City’, API name = {!Billing_City_Screen}, Type = ‘Text’, Default Value = {!BillingCity}
- After the screen element, add an Assignment element to assign the value the User has entered for the variable.
- Example: {!BillingCity} = {!Billing_City_Screen}
Please note: As long as the user clicks Next after the screen element, the Flow will continue to the Assignment element and assign the variables. If the user exits the Flow and returns later, it will display the values they entered the last time they accessed the form. If they do not click Next before exiting the Flow, the values they previously entered will be lost.
Adding Tables to Flows
Just as we introduced Active Form Tables to work with Elements-based forms, we've created a custom table component to allow Screen Flows to create multiple records simultaneously. To add a table to a Flow:
- Search for the Practifi - Data Table (Dynamic Rows) component available in the component menu in the left sidebar.
- Drag and drop the component to the desired location within the screen.
- In the right sidebar, search for and select the object you want the table to represent from the Table Object picklist. Once selected, you’ll see the remaining options become available.
- Decide what combination of record create, update and delete actions users can perform with the table from the Purpose picklist. If you choose the create option, then an Add a New Row button appears at the bottom of the table. If you choose a delete option, a Delete button appears to the right of table rows.
- Optionally, you can enter text into the Label field if you want a description to appear above the table.
- Click the Configure Columns button to open the pop-up window to define what columns appear in the table.
- Add the desired columns one by one from the drop-down menu at the top. Columns can be taken either from the Table Object you specified in Step 1 or from related records accessed via lookup fields. Once selected, columns will appear in the preview table below.
- Each column has a caret in its header. Click the caret to display basic configuration options to move a column to the left or right or delete it.
- Click the Configure button to view more advanced settings:
- Label - By default, column headings are the same as the label of the field they represent. You can override that value with a custom label here.
- Prefill User-Created Rows - Use this setting when users are creating records with the table, but you don’t want them to have to provide certain values. For example, if your table was for creating contacts within a specific household, the Primary Entity of those contacts needs to appear as a table column, but it can be prefilled because it’s the same value every time. Prefilling can be done using static values or by specifying a Flow Resource, allowing you to dynamically prefill based on data in related records, external systems and more.
- Display Mode - Editable, Read-Only or Hidden. This is useful in situations like the above example, where the field shouldn’t be made editable, as all it does is invite the risk of user error. It might be preferable to hide the column completely and save screen real estate.
- Display as Picklist - This toggle switch appears for columns based on lookup fields and allows them to appear as drop-down menus rather than search fields. This can be useful if there are a few available options and users prefer to see what’s available rather than searching for it.
-
The Manage Filter Criteria tab appears in the Configure pop-up window for columns based on lookup fields and allows you to restrict the records that appear in the search results or the drop-down menu (if displayed as a picklist). This tab uses the Rule Builder component introduced in Petit Verdot to make it easy to create complex filter criteria.
-
If you’re displaying existing records with the table, you’ll need to specify the Data Source for those records. Data sources come in two forms:
-
Records - Uses a record collection variable to populate the table. Because the items in the collection are all records, the table knows how to locate the IDs.
-
Record Ids - Uses a collection variable to populate the table, where each value in the collection is a Record ID.
-
Once you’ve finished configuring the table component itself, you’ll want to make sure you incorporate any changes the user makes within it into the data model. To do this, include a Process Data Table Data action at a later stage of the Flow.
If you want to present the data again later on in the Flow, such as to let the user review their changes before finalizing them, there are three arrays (lists of records) that the table creates for you:
- outputRecordsToCreate
- outputRecordsToUpdate
- outputRecordsToDelete.
You can use these arrays in subsequent Flow elements to retrieve those records for on-screen display or other purposes.
End User Experience
For end users, Active Forms built with Flow Builder behave similarly to those built using Form Elements. They can appear within the Start a Process and New Task (from template) actions, in the Active Form tab on the Task record page once you’ve created them and within the Mark as Complete action as a final confirmation step.
The look and feel of Flow Builder forms themselves are slightly different due to the way Flow Builder presents screens and because there are more ways to configure the form’s appearance.
Making Required Fields
Required fields are supported in Flow Builder, but they are configured differently than they are in Elements-based forms. For a Task to be completed successfully, the Flow Interview—the running instance of the Flow associated with that Task—must also be completed.
Completing the Flow Interview typically involves clicking a Finish button on the final screen, but this depends on how the Flow is designed. To do that, the required fields on those screens need to be provided. This provides enforcement around the completion of required fields.
Including a Flow in the Start a Process and New Task (from template) Actions
Flows can appear in the Start a Process and New Task (from template) actions in the same way as Elements-based forms. To enable this, there is a setting on the Active Form Flow record called Appears in that controls whether the Flow appears in the launch action, on the Task record page or in both places.
We’ve implemented this setting because of the different ways in which Flow-based forms interact with the Practifi data model.
- When an Elements-based form appears in a launch action, it creates the Task record simultaneously so that form capabilities such as prefill logic and display criteria still behave as intended. If the user closes the action without completing it, the Task is immediately deleted to prevent extraneous records from being created.
- When a Flow-based form appears in a launch action, it cannot create a Task record or delete it, meaning any references to the Task record it attempts to use will result in an error. However, you can create an input text variable called processTaskId to retrieve the Process Task record ID instead, which provides access to some prefilling capabilities.
This means if you want to display a Flow in the launch action, you have two options:
-
Create a separate Flow for the launch action:
- This requires your configuration to pass the launch action Flow’s variables to the Task record page’s Flow using Active Form Variables.
- Flows that appear exclusively in launch actions must be completed as a part of completing the action itself. This means that the user won’t be able to proceed past that screen until the Flow Interview is completed.
-
Use the same Flow for both the launch action and the Task record page:
- This requires your Flow to use custom error handling logic to display an alternative screen when the active Task record can’t be located and prevent the user from proceeding to the screens that reference the active Task until the Flow is accessed from the Task record page itself, at which point it can define the relevant variables.
- Flows that appear in both places have no additional enforcement within the launch action.
Using Flow Builder Forms in Portals
Active Form Flows made available in Portals behave differently depending on the validation settings:
- When the Validate Form setting is disabled, the Task completion proceeds as usual. The actions associated with the Active Form Flow will take place as configured. This also means that internal users cannot see any Flow Interviews.
- When the Validate Form setting is enabled, the Task is reassigned to the internal user as per assignment type. When the internal user opens the task, a new Flow Interview will be started. If the flow has default values specified in the screen elements, the values previously saved by the portal user will be visible to the internal user in the new Flow Interview. This will allow the internal user to modify data if needed and complete the Task.
Error Handling
By default, when errors occur while completing a Flow, an error message is displayed, and users are not provided with a way to continue.
Flow Builder provides options for customizing what happens when errors occur, such as sending emails, showing a custom error message, diverting the user to a different screen, executing other automation or simply bypassing the error completely.
If the Allow restarts when there’s an error? setting on the Active Form Flow record is enabled, then whenever the Flow Interview encounters an error, a Restart button appears, allowing the user to go back to the beginning without having to build any error-handling logic into the Flow itself.
Displaying Flow Inputs on Completed Tasks
As of the Pinot Blanc release, you can configure an Active Form Flow to display the data entered during the Flow interview on completed Task records. The information will appear on the Active Form tab of a Task once it has been marked as complete.
To enable this, administrators can edit the Screen Flow in Flow Builder to add a Decision element based on Task status and a Screen element with a Display Text component. Then they can create another instance of the Active Form Flow and configure it to display in completed Task records.
Edit the Flow in Flow Builder
To configure a Screen Flow to display values on completed Task records, do the following:
- Open Salesforce Setup by selecting the gear icon and selecting Setup from the drop-down menu.
- In Salesforce Setup, use the Quick Find to search for and select Flows.
- On the Flows page, click the hyperlinked name of the Flow you want to edit.
- In the Flow Builder, add a Decision element after the Get Task element.
- Configure the Decision element to check whether the Status field on the Task is Completed or not equal to Completed.
- Add a Screen element after the Task Completed outcome.
- Edit the Screen element and add a Display Text component.
- Configure the Display Text component to include each of the text variables that the user inputs on the Task Not Completed side of the Flow.
Please note: As shown in the example above, we recommend adding contextual labels before each variable to indicate the question or field name related to the input being displayed. This will help users understand what data they're looking at when viewing a completed Task record. - Click Done to exit the edit window.
- At the top of the Flow Builder, click Save As to save a new version of the Flow.
- Click Activate to activate the latest version of the Flow.
Edit the Active Form Flow
To enable a Flow-based Active Form to display data on completed Task records, do the following:
- Open the Process Task or Task Template record and click the Active Form tab.
- In the Active Form Flows section, copy the API Name of the existing Active Form Flow.
- In the Active Form Flows section, click the New button.
- On the New Active Form Flow screen, paste the API Name you copied into the API Name field.
- Check the Active box.
- Click Save. A success message appears.
- On the Active Form Flow record you just saved, click the pencil icon in the Appears in field.
- Click the Appears in picklist and select Completed task record pages.
- Click Save.
Flow Builder Validation Check
Flows built with Flow Builder are not evaluated by Validation Check, but the configuration that links them with the workflow is. Here’s how that works in practice:
- Fields on a Flow Screen mapped to an action inside that same Flow are not evaluated because everything occurs within the Flow.
- Fields on a Flow Screen mapped to a workflow action, i.e., an action outside the Flow, are evaluated, but only partially. Validation Check can confirm whether all the required fields in a workflow action have mappings assigned, but it can’t confirm the data type of the Flow Variable, so if there’s a mismatch between that and the data type of the mapped field, this won’t be flagged.
- If there’s a Flow configured to appear during the launch action but not one configured to appear on the Task record page, or vice-versa, that is evaluated because all the necessary information to do so can be accessed from the data model.
We recommend taking full advantage of Flow Builder’s extensive testing capabilities to validate the Flow itself and double-check any variables you map to workflow actions, as these won’t be addressed by Flow Builder’s testing or Validation Check.
Here are the specific scenarios covered by the Validation Check component:
Validation | Checked on | Method | Error Message |
Launch task has a record page Flow but no launch action Flow | Process Task record |
If the Process Task is either a Task Template or Suppress at Launch is false, and there’s an Active Form Flow set to appear on the record page and no Flow set to appear in the launch action, then this issue is flagged. |
This Task is part of the workflow’s launch action, however the Active Form it contains isn’t configured to display there. |
Launch task has a launch action Flow but no record page Flow | Process Task record |
If the Process Task is either a Task Template or Suppress at Launch is false, and there’s an Active Form Flow set to appear in the launch action and no Flow set to appear on the record page, then this issue is flagged. |
This Task is part of the workflow’s launch action, however the Active Form it contains is configured to appear there, but not on the Task record page. |
Flow Builder Considerations
Please keep the following in mind when building Active Forms using Flow Builder:
- Pinned Fields are currently unavailable when building an Active Form using Flow Builder. If you try to include pinned fields on a Process Task with a Flow-based Active Form, they won’t appear on the Task’s record page.
-
If you want to allow users to see what was captured within a Screen Flow after a Task with a Flow-based Active Form is completed, see the instructions in the Displaying Flow Inputs on Completed Tasks section.
- If you want to prefill Active Form Fields using values collected in a previous Task in a Process, you can use a Get Records element in Flow Builder.
Flow Builder Resources
To learn more about working with Flow Builder, please consult the following Salesforce resources:
Comments
Article is closed for comments.