Skip to main content

Durée estimée

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.

Final flow, with all elements.

There are four elements in the flow—here’s what each of them does.

  1. Gets the user’s information
  2. Asks customers for their data privacy settings
  3. Creates an individual record based on the privacy settings
  4. 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

  1. Click Setup and select Setup.
  2. In the Quick Find box, search for and select Flows.
  3. Click New Flow.
  4. Under Categories, select Screen.
  5. Select Screen Flow.
  6. In Flow Builder, click Toggle Toolbox to open the toolbox, then click New Resource.
  7. Select Variable from the Resource Type dropdown menu and enter these details.
    • API Name: LoginFlow_UserId
    • Data Type: Text
    • Select Available for input
  8. Click Done
  9. Click New Resource, select Variable from the Resource Type menu again, and enter these details.
    • API Name: registrantsAccount
    • Data Type: Text
  10. 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.

  1. Click Save.
  2. Name the flow.
    • Flow Label: Privacy Settings
    • Flow API Name: Privacy_Settings
  3. Click Show Advanced.
  4. Select these settings.
    • How to Run the Flow: System Context Without Sharing—Access All Data
    • Type: Screen Flow (this should already be selected)
  5. 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

Partagez vos commentaires sur Trailhead dans l'aide Salesforce.

Nous aimerions connaître votre expérience avec Trailhead. Vous pouvez désormais accéder au nouveau formulaire de commentaires à tout moment depuis le site d'aide Salesforce.

En savoir plus Continuer à partager vos commentaires