Skip to main content

Assign the Login Flow and Test It in Your Portal

Learning Objectives 

After completing this unit, you’ll be able to:

  • Assign your flow as the portal’s login flow.
  • Test your login flow to make sure it creates a new contact and individual record.

Assign the Login Flow

So you created an amazing registration flow and laid the groundwork in your org and portal for it to work. Now what? Connect the dots and test out the implementation to see how it works. 

First things first: assigning the login flow you created in the Create a Self-Registration Flow for an Experience Cloud Site project to the profile you just set up. 

  1. From Setup, enter Login Flows in the Quick Find box and then select Login Flows.
  2. Click New and fill out the information for the flow and profile you need. In this case:
    • Type: Flow
    • Name: Privacy Settings
    • Flow: Privacy_Settings
    • User License: Customer Community
    • Profile: Customer Account Portal
  3. Click Save.

You’ve now made your registration flow visible only to folks accessing the portal with the correct profile. 

Test Your Login Flow

Let’s publish and activate the portal so you can test the flow. 

  1. Navigate to your portal’s Experience Builder (Setup | Digital Experiences | All Sites | Builder next to the portal).
  2. In Experience Builder, click Publish, and in the confirmation dialogue, click Publish again, and then click Got It.
  3. Navigate to Administration in Experience Workspaces.
  4. You should already be on Settings by default, but if not, click Settings.
  5. Click Activate and then click OK.

Activating a site makes it available to members, and sends a welcome message. 

Now let’s test the login flow to make sure it works. To do so, you have to: Create a user for the portal, log in as the new user, go through the login flow, and finally check that the right records have been created and updated. Let’s see how it’s done.

  1. From Setup, enter All Sites in the Quick Find box and then click All Sites.
  2. Copy your portal’s URL (the one ending in /accountportal) and paste it into an incognito browser window. Going incognito ensures that you’re logged out of the portal for testing purposes.
  3. You should see the portal’s home page after going incognito. Click Login at the top of the page to continue with testing.
  4. Click the Not a member? link in the login window. If you don't see the link, you haven't set up self-registration for your site. Make sure you've done so and published and activated the site.Not a member? link on the sign up page
  5. When prompted to create a new user, create a user. Enter an email address that is different from the email address you used to set up your Trailhead Playground, but one that you can still access easily.
  6. Click Sign Up. You’ll be asked to check your email for a link to complete your account portal registration. Message telling people to check their email.
  7. Check your email and click the link.
  8. Step through the login registration flow and select all the checkboxes set up in the flow.Screenshot showing the following checkboxes in the flow: I don't want to be contacted; I don't want you to track my usage; I don't want you to track my location.
  9. Click Next and then click Finish.

Complete the registration process by setting up a password. You should be taken to the portal’s homepage. Now that you’ve set up a new portal user, jump back into your org as the admin to see that everything you expected to happen has actually happened.

  1. Click the App Launcher icon in the browser window where you’re logged in as the Salesforce admin.
  2. In the Search apps or items search box, enter Contacts and then click Contacts.
  3. Switch to the All Contacts list view.All Contacts list view.
  4. Click the name of the new contact you created.
  5. Click the Details tab. Notice that the newly created contact record is part of the Registrants account and has the right Individual record associated.
  6. Click the name in the Individual field, and then click the Details tab.
  7. Note that all the checkboxes you selected in the registration process are actually selected in the record.

Mary Hollywood’s privacy settings record detail, with the privacy settings selected.

Pat yourself on the back for a job well done.

Congratulations! You’ve barreled through creating a customer account portal that captures customers’ data privacy settings. Want to take it up a notch and add Lightning Knowledge and Chat to your portal? Check out Build a Community with Knowledge and Chat to see how it’s done.

Keep learning for
free!
Sign up for an account to continue.
What’s in it for you?
  • Get personalized recommendations for your career goals
  • Practice your skills with hands-on challenges and quizzes
  • Track and share your progress with employers
  • Connect to mentorship and career opportunities