Set Up Record Variables
Learning Objectives
In this project, you’ll use Flow Builder to build a self-registration flow that:
- Allows customers to self-register to a portal.
- Captures information from the customer.
- Creates an individual record for the user to store communication preferences.
- Updates the contact record with information from the individual record.
Introduction
This project walks you through creating a self-registration login flow. Login flows customize the login experience and integrate business processes with Salesforce authentication. In this example, we ask users to choose their data privacy settings. By the end of the project, you’ll have a fully functional flow, which you can use in the Self-Registration in a Portal module. Let’s get this party started!
Create a New Trailhead Playground
For this project, you need to create a new Trailhead Playground. Scroll to the bottom of this page, click the playground name, then click Create Playground. It typically takes 3–4 minutes to create a new Trailhead Playground.
Yes, we really mean a brand-new Trailhead playground! If you use an existing org or playground, you can run into problems completing the challenges.
Overall Flow Design
Here’s what the final flow looks like in Flow Builder.
There are five elements in the flow—here’s what each of them does.
- Gets the user’s information
- Asks customers for their data privacy settings
- Creates an individual record based on the privacy settings
- Updates the contact record (created in the self-registration steps for the portal) with the correct privacy settings
- Welcomes a new member to the portal
Before setting up the flow, however, we first have to set up record variables (watch the What is a Variable? video to learn more) that are used throughout the flow.
Set Up Record Variables
- In Setup, enter
Flows
in the Quick Find box, then select Flows.
- Click New Flow.
- Make sure Start from Scratch is selected, and click Next.
- Select Screen Flow.
- Click Create.
- Click to show the toolbox, then click New Resource.
- Select Variable from the Resource Type dropdown menu and enter the following.
- API Name:
contactId
- Data Type: Text
- Click Done.
Repeat these steps to create other variables with the following properties.
Record Type |
Values |
---|---|
Variable |
|
Variable |
|
Variable |
|
Variable |
|
The record variable stores updatable field values for a Salesforce record. Basically, the flow uses this variable to temporarily store the data as users go through the flow.
At this point, let’s save our work, because nothing is worse than failing to save something you’ve worked on (especially a flow).
- Click Save.
- Name the flow.
- Flow Label:
Privacy Settings
- Flow API Name:
Privacy_Settings
- Click Show Advanced.
- Select the following settings.
- How to Run the Flow: System Context Without Sharing - Access All Data
- Type: Screen Flow (this should already be selected)
- Click Save. If you get a warning, cancel out of it.
Now that you’ve set up your variables, you’re ready to start creating the flow.
Resources