Set Up Record Variables
Learning Objectives
In this project, you 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.
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, you 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 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 four 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
- Welcomes a new member to the portal
Before setting up the flow, however, you 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
- Click
and select Setup.
- In the Quick Find box, search for and select Flows.
- Click New Flow.
- Under Categories, select Screen.
- Select Screen Flow.
- In Flow Builder, click
to open the toolbox, then click New Resource.
- Select Variable from the Resource Type dropdown menu and enter these details.
- API Name:
LoginFlow_UserId
- Data Type: Text
- Select Available for input
- API Name:
- Click Done
- Click New Resource, select Variable from the Resource Type menu again, and enter these details.
- API Name:
registrantsAccount
- Data Type: Text
- API Name:
- Click Done.
A 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, save your work.
- Click Save.
- Name the flow.
- Flow Label:
Privacy Settings
- Flow API Name:
Privacy_Settings
- Flow Label:
- Click Show Advanced.
- Select these settings.
- How to Run the Flow: System Context Without Sharing—Access All Data
- Type: Screen Flow (this should already be selected)
- How to Run the Flow: System Context Without Sharing—Access All Data
- Click Save.
You may notice a flag in the Flow Builder navigation bar, alerting you to an error and warning. You can ignore it for now. The error and warning resolve as you complete later steps to build the flow.
Now that you set up your variables, you’re ready to start creating the flow.
Resources